Ice 3.7 C++98 API Reference
|
Go to the documentation of this file.
5 #ifndef ICESSL_PLUGIN_H
6 #define ICESSL_PLUGIN_H
12 #ifdef ICE_CPP11_MAPPING
22 # if defined(ICE_STATIC_LIBS)
24 # elif defined(ICESSL_API_EXPORTS)
25 # define ICESSL_API ICE_DECLSPEC_EXPORT
27 # define ICESSL_API ICE_DECLSPEC_IMPORT
37 #ifdef ICE_CPP11_MAPPING
168 #ifndef ICE_CPP11_COMPILER
174 #ifndef ICE_CPP11_MAPPING
187 static const char* _name;
200 #ifndef ICE_CPP11_COMPILER
206 #ifndef ICE_CPP11_MAPPING
219 static const char* _name;
232 #ifndef ICE_CPP11_COMPILER
238 #ifndef ICE_CPP11_MAPPING
251 static const char* _name;
311 bool match(
const std::string& dn)
const;
317 operator std::string()
const;
327 std::list<std::pair<std::string, std::string> > _rdns;
328 std::list<std::pair<std::string, std::string> > _unescaped;
364 return !(lhs == rhs);
372 #ifndef ICE_CPP11_MAPPING
394 virtual std::vector<Ice::Byte>
getData()
const = 0;
407 #ifdef ICE_CPP11_MAPPING
408 public std::enable_shared_from_this<Certificate>
464 #ifdef ICE_CPP11_MAPPING
465 virtual bool checkValidity(
const std::chrono::system_clock::time_point& t)
const = 0;
492 #ifdef ICE_CPP11_MAPPING
493 virtual std::chrono::system_clock::time_point getNotAfter()
const = 0;
502 #ifdef ICE_CPP11_MAPPING
503 virtual std::chrono::system_clock::time_point getNotBefore()
const = 0;
605 #ifndef ICE_CPP11_MAPPING // C++98 mapping
675 #ifdef ICE_CPP11_MAPPING
676 virtual void setCertificateVerifier(std::function<
bool(
const std::shared_ptr<ConnectionInfo>&)> v) = 0;
686 #ifdef ICE_CPP11_MAPPING
687 virtual void setPasswordPrompt(std::function<std::string()> p) = 0;
bool operator>(const DistinguishedName &lhs, const DistinguishedName &rhs)
Performs an exact match.
Definition: Plugin.h:335
In order to read an encrypted file, such as one containing a private key, OpenSSL requests a password...
Definition: Plugin.h:644
virtual CertificateReadException * ice_clone() const
Creates a shallow copy of this exception.
virtual CertificateEncodingException * ice_clone() const
Creates a shallow copy of this exception.
virtual std::string ice_id() const
Returns the type ID of this exception.
Definition: ConnectionInfo.h:138
const unsigned int KEY_USAGE_DECIPHER_ONLY
The key usage "decipherOnly" bit is set.
Definition: Plugin.h:127
const unsigned int EXTENDED_KEY_USAGE_CODE_SIGNING
The extended key usage "codeSigning" bit is set.
Definition: Plugin.h:144
std::string getHost(const IceSSL::ConnectionInfoPtr &)
std::string getTrustErrorDescription(TrustError)
@ InvalidTime
The X509 chain is not valid due to an invalid time value, such as a value that indicates an expired c...
Definition: Plugin.h:73
Represents an X509 Certificate extension.
Definition: Plugin.h:375
#define ICE_DEFINE_PTR(TPtr, T)
Definition: Config.h:377
A communicator plug-in.
Definition: Plugin.h:198
virtual ~CertificateReadException()
virtual ~ParseException()
@ HasExcludedNameConstraint
The X509 chain is invalid because a certificate has excluded a name constraint.
Definition: Plugin.h:48
virtual bool operator==(const Certificate &) const =0
Compares the certificates for equality using the native certificate comparison method.
const unsigned int EXTENDED_KEY_USAGE_TIME_STAMPING
The extended key usage "timeStamping" bit is set.
Definition: Plugin.h:152
unsigned int getKeyUsage() const
Returns the value of the key usage extension.
@ UntrustedRoot
The X509 chain is invalid due to an untrusted root certificate.
Definition: Plugin.h:83
const unsigned int KEY_USAGE_ENCIPHER_ONLY
The key usage "encipherOnly" bit is set.
Definition: Plugin.h:123
const unsigned int EXTENDED_KEY_USAGE_EMAIL_PROTECTION
The extended key usage "emailProtection" bit is set.
Definition: Plugin.h:148
const unsigned int EXTENDED_KEY_USAGE_CLIENT_AUTH
The extended key usage "clientAuth" bit is set.
Definition: Plugin.h:140
virtual bool isCritical() const =0
Determines whether the information in this extension is important.
virtual bool checkValidity(const IceUtil::Time &t) const =0
Checks that the certificate is valid at the given time.
const unsigned int EXTENDED_KEY_USAGE_ANY_KEY_USAGE
The extended key usage "anyKeyUsage" bit is set.
Definition: Plugin.h:132
virtual std::vector< Ice::Byte > getData() const =0
Obtains the data associated with this extension.
const unsigned int KEY_USAGE_CRL_SIGN
The key usage "cRLSign" bit is set.
Definition: Plugin.h:119
@ HasNonDefinedNameConstraint
The certificate has an undefined name constraint.
Definition: Plugin.h:50
virtual void setCertificateVerifier(const CertificateVerifierPtr &v)=0
Establish the certificate verifier object.
@ InvalidPolicyConstraints
The X509 chain is invalid due to invalid policy constraints.
Definition: Plugin.h:66
@ NotTrusted
The certificate is explicitly not trusted.
Definition: Plugin.h:75
const unsigned int KEY_USAGE_DATA_ENCIPHERMENT
The key usage "dataEncipherment" bit is set.
Definition: Plugin.h:107
Represents the IceSSL plug-in object.
Definition: Plugin.h:665
virtual CertificatePtr decode(const std::string &str) const =0
Decode a certificate from a string that uses the PEM encoding format.
bool operator<=(const DistinguishedName &lhs, const DistinguishedName &rhs)
Performs an exact match.
Definition: Plugin.h:344
@ InvalidBasicConstraints
The X509 chain is invalid due to invalid basic constraints.
Definition: Plugin.h:60
Thrown if the certificate cannot be read.
Definition: Plugin.h:163
const unsigned int KEY_USAGE_KEY_AGREEMENT
The key usage "keyAgreement" bit is set.
Definition: Plugin.h:111
virtual std::vector< std::pair< int, std::string > > getSubjectAlternativeNames() const =0
See the comment for Plugin::getIssuerAlternativeNames.
IceUtil::Handle< PasswordPrompt > PasswordPromptPtr
Definition: Plugin.h:657
DistinguishedName(const std::string &name)
Creates a DistinguishedName from a string encoded using the rules in RFC2253.
Thrown if the certificate cannot be encoded.
Definition: Plugin.h:195
virtual std::vector< Ice::Byte > getAuthorityKeyIdentifier() const =0
Obtains the authority key identifier.
DistinguishedName(const std::list< std::pair< std::string, std::string > > &)
Creates a DistinguishedName from a list of RDN pairs, where each pair consists of the RDN's type and ...
const unsigned int KEY_USAGE_KEY_ENCIPHERMENT
The key usage "keyEncipherment" bit is set.
Definition: Plugin.h:103
CertificateEncodingException(const char *, int, const std::string &)
std::string reason
The reason for the exception.
Definition: Plugin.h:183
@ PartialChain
The X509 chain could not be built up to the root certificate.
Definition: Plugin.h:77
@ HostNameMismatch
A host name mismatch has occurred.
Definition: Plugin.h:58
virtual std::vector< Ice::Byte > getSubjectKeyIdentifier() const =0
Obtains the subject key identifier.
virtual DistinguishedName getSubjectDN() const =0
Obtains the subject's distinguished name (DN).
static CertificatePtr load(const std::string &file)
Loads the certificate from a file.
virtual bool verify(const CertificatePtr &cert) const =0
Verifies that this certificate was signed by the given certificate public key.
virtual ~CertificateVerifier()
virtual CertificatePtr load(const std::string &file) const =0
Load the certificate from a file.
IceUtil::Handle< CertificateVerifier > CertificateVerifierPtr
Definition: Plugin.h:625
virtual X509ExtensionPtr getX509Extension(const std::string &oid) const =0
Obtains the extension with the given OID.
@ ChainTooLong
The certificate chain length is greater than the specified maximum depth.
Definition: Plugin.h:46
const unsigned int EXTENDED_KEY_USAGE_SERVER_AUTH
The extended key usage "serverAuth" bit is set.
Definition: Plugin.h:136
bool operator>=(const DistinguishedName &lhs, const DistinguishedName &rhs)
Performs an exact match.
Definition: Plugin.h:353
const unsigned int KEY_USAGE_DIGITAL_SIGNATURE
The key usage "digitalSignature" bit is set.
Definition: Plugin.h:95
virtual IceUtil::Time getNotBefore() const =0
Obtains the not-before validity time.
An application can customize the certificate verification process by implementing the CertificateVeri...
Definition: Plugin.h:613
This class represents a DistinguishedName, similar to the Java type X500Principal and the ....
Definition: Plugin.h:268
virtual std::string getOID() const =0
Obtains the object ID of this extension.
virtual int getVersion() const =0
Obtains the certificate version number.
@ RevocationStatusUnknown
It is not possible to determine whether the certificate has been revoked.
Definition: Plugin.h:79
virtual std::vector< std::pair< int, std::string > > getIssuerAlternativeNames() const =0
Obtains the values in the issuer's alternative names extension.
#define ICESSL_API
Definition: Plugin.h:27
@ InvalidExtension
The X509 chain is invalid due to an invalid extension.
Definition: Plugin.h:62
@ HasNonPermittedNameConstraint
The certificate has a non permitted name constraint.
Definition: Plugin.h:52
bool operator!=(const DistinguishedName &lhs, const DistinguishedName &rhs)
Performs an exact match.
Definition: Plugin.h:362
virtual DistinguishedName getIssuerDN() const =0
Obtains the issuer's distinguished name (DN).
virtual void setPasswordPrompt(const PasswordPromptPtr &p)=0
Establish the password prompt object.
@ InvalidPurpose
The supplied certificate cannot be used for the specified purpose.
Definition: Plugin.h:68
@ InvalidNameConstraints
The X509 chain is invalid due to invalid name constraints.
Definition: Plugin.h:64
TrustError
The reason for an IceSSL certificate verification failure.
Definition: Plugin.h:42
virtual bool checkValidity() const =0
Checks that the certificate is currently valid, that is, the current date falls between the validity ...
CertificateReadException(const char *, int, const std::string &)
This convenience class is a wrapper around a native certificate.
Definition: Plugin.h:412
unsigned int getExtendedKeyUsage() const
Returns the value of the extended key usage extension.
@ HasNonSupportedNameConstraint
The certificate does not have a supported name constraint or has a name constraint that is unsupporte...
Definition: Plugin.h:56
const unsigned int KEY_USAGE_NON_REPUDIATION
The key usage "nonRepudiation" bit is set.
Definition: Plugin.h:99
@ NoError
The certification verification succeed.
Definition: Plugin.h:44
static CertificatePtr decode(const std::string &str)
Decodes a certificate from a string that uses the PEM encoding format.
virtual std::vector< X509ExtensionPtr > getX509Extensions() const =0
Obtains a list of the X509v3 extensions contained in the certificate.
virtual IceUtil::Time getNotAfter() const =0
Obtains the not-after validity time.
const unsigned int KEY_USAGE_KEY_CERT_SIGN
The key usage "keyCertSign" bit is set.
Definition: Plugin.h:115
virtual std::string encode() const =0
Obtains a string encoding of the certificate in PEM format.
@ UnknownTrustFailure
The X509 chain is invalid due to other unknown failure.
Definition: Plugin.h:85
std::string reason
The reason for the exception.
Definition: Plugin.h:215
This exception is thrown if a distinguished name cannot be parsed.
Definition: Plugin.h:227
bool match(const DistinguishedName &dn) const
Performs a partial match with another DistinguishedName.
TrustError getTrustError(const IceSSL::ConnectionInfoPtr &)
::IceInternal::Handle< ConnectionInfo > ConnectionInfoPtr
Definition: ConnectionInfo.h:140
friend bool operator<(const DistinguishedName &, const DistinguishedName &)
Performs an exact match.
std::string reason
The reason for the exception.
Definition: Plugin.h:247
@ Revoked
The X509 chain is invalid due to a revoked certificate.
Definition: Plugin.h:81
virtual bool operator!=(const Certificate &) const =0
Compares the certificates for equality using the native certificate comparison method.
bool match(const std::string &dn) const
Performs a partial match with another DistinguishedName.
virtual std::string getPassword()=0
Obtains the password.
virtual ~PasswordPrompt()
virtual bool verify(const ConnectionInfoPtr &info)=0
Determines whether to accept a certificate.
Helper template for the implementation of Ice::Exception.
Definition: Exception.h:161
@ InvalidSignature
The X509 chain is invalid due to an invalid certificate signature.
Definition: Plugin.h:70
virtual ~CertificateEncodingException()
virtual ParseException * ice_clone() const
Creates a shallow copy of this exception.
virtual std::string ice_id() const
Returns the type ID of this exception.
const unsigned int EXTENDED_KEY_USAGE_OCSP_SIGNING
The extended key usage "OCSPSigning" bit is set.
Definition: Plugin.h:156
virtual std::string getSerialNumber() const =0
Obtains the serial number.
friend bool operator==(const DistinguishedName &, const DistinguishedName &)
Performs an exact match.
virtual std::string toString() const =0
Stringifies the certificate.
virtual std::string ice_id() const
Returns the type ID of this exception.
ParseException(const char *, int, const std::string &)
@ HasNonSupportedCriticalExtension
The certificate does not support a critical extension.
Definition: Plugin.h:54