5#include <system/object.h>
6#include <system/array.h>
7#include <system/idisposable.h>
8#include <system/date_time.h>
9#include <system/security/secure_string.h>
10#include <security/cryptography/x509_certificates/x509_content_type.h>
11#include <security/cryptography/x509_certificates/x509_key_storage_flags.h>
12#include <security/cryptography/hash_algorithm_name.h>
14namespace System {
namespace Security {
namespace Cryptography {
namespace X509Certificates {
16class X500DistinguishedName;
17namespace Details {
struct X509CertificateImpl; }
93 ASPOSECPP_SHARED_API
void Dispose()
override;
205 virtual ASPOSECPP_SHARED_API
void Reset();
235 const std::unique_ptr<Details::X509CertificateImpl>
m_pimpl;
Represents a specific date and time value on the time continuum. This type should be allocated on sta...
Definition: date_time.h:50
Defines method that releases resources owned by the current object. Objects of this class should only...
Definition: idisposable.h:30
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
X.509 v.3 certificate. Encrypted certificates are not supported. Only X509KeyStorageFlags::DefaultKey...
Definition: x509_certificate.h:29
ByteArrayPtr GetRawCertHash() const
virtual String GetKeyAlgorithmParametersString() const
Gets key information for the current certificate as a hexadecimal string.
virtual void Import(const ByteArrayPtr &data, const String &password, X509KeyStorageFlags key_storage_flags)
Imports information from the specified certificate data. NOT IMPLEMENTED.
SharedPtr< X500DistinguishedName > GetIssuerNameInternal() const
X509Certificate(const ByteArrayPtr &raw_data, const ByteArrayPtr &private_key, X509KeyStorageFlags key_storage_flags)
Constructor.
virtual ByteArrayPtr Export(X509ContentType content_type, const String &password) const
Exports the current object to a byte array using the specified format. NOT IMPLEMENTED.
virtual void Import(const ByteArrayPtr &data)
Imports information from the specified certificate data. NOT IMPLEMENTED.
virtual void Reset()
Resets the certificate state.
virtual void Import(const String &filename, const SecureStringPtr &password, X509KeyStorageFlags key_storage_flags)
Imports information from the specified certificate file. NOT IMPLEMENTED.
virtual String GetEffectiveDateString() const
Gets effective date of the current sertificate.
void Dispose() override
Does nothing.
X509Certificate(const SharedPtr< X509Certificate > &cert)
Constructor.
int32_t GetHashCode() const override
Gets certificate hash code.
bool Equals(SharedPtr< Object > obj) override
Compares two certificates.
virtual String GetPublicKeyString() const
Gets public key from certificate as a hexadecimal string.
virtual String ToString(bool verbose) const
Returns the certificate information in text format.
String get_Issuer() const
Gets name of the certificate authority that issued the X.509v3 certificate.
ByteArrayPtr GetRawKeyAlgorithmParameters() const
String ToString() const override
Returns the certificate information in text format.
virtual String GetKeyAlgorithm() const
Gets key information for the current certificate as a string.
virtual ByteArrayPtr GetCertHash() const
Gets hash for the current object as an array of bytes.
virtual ByteArrayPtr GetSerialNumber() const
Gets serial number from certificate as array of bytes.
virtual String GetCertHashString() const
Gets SHA1 hash for the current object as a hexadecimal string.
virtual void Import(const ByteArrayPtr &data, const SecureStringPtr &password, X509KeyStorageFlags key_storage_flags)
Imports information from the specified certificate data. NOT IMPLEMENTED.
IntPtr get_Handle() const
Gets a handle to Microsoft Cryptographic API certificate context.
virtual String GetFormat() const
Gets name of the certificate format.
String get_Subject() const
Gets subject distinguished name from certificate.
X509Certificate & operator=(const X509Certificate &)=delete
virtual ByteArrayPtr Export(X509ContentType content_type) const
Exports the current object to a byte array using the specified format. NOT IMPLEMENTED.
X509Certificate(const ByteArrayPtr &data)
Constructor.
virtual String GetCertHashString(const HashAlgorithmName &hash_algorithm) const
Gets SHA1 hash for the current object as a hexadecimal string.
virtual ByteArrayPtr GetPublicKey() const
Gets public key from certificate as array of bytes.
X509Certificate(const String &filename, const String &password)
Constructor.
virtual void Import(const String &filename, const String &password, X509KeyStorageFlags key_storage_flags)
Imports information from the specified certificate file. NOT IMPLEMENTED.
virtual ByteArrayPtr GetCertHash(const HashAlgorithmName &hash_algorithm) const
Gets hash for the current object as an array of bytes.
virtual String GetIssuerName() const
Gets name of the certification authority that issued the current certificate.
virtual ByteArrayPtr Export(X509ContentType content_type, const SecureStringPtr &password) const
Exports the current object to a byte array using the specified format. NOT IMPLEMENTED.
virtual String GetExpirationDateString() const
Gets expiration date of the current sertificate.
SharedPtr< X509Certificate > Ptr
Pointer type.
Definition: x509_certificate.h:34
X509Certificate(const ByteArrayPtr &raw_data, const String &password, X509KeyStorageFlags key_storage_flags)
Constructor.
X509Certificate(const ByteArrayPtr &raw_data, const SecureStringPtr &password, X509KeyStorageFlags key_storage_flags)
Constructor.
X509Certificate(const X509Certificate &)=delete
virtual String GetName() const
Gets name of the principal to witch the current sertificate was issued.
SharedPtr< X500DistinguishedName > GetSubjectNameInternal() const
virtual void Import(const String &filename)
Imports information from the specified certificate file. NOT IMPLEMENTED.
static String FormatDate(DateTime dt)
void VerifyCertificateCreated() const
const std::unique_ptr< Details::X509CertificateImpl > m_pimpl
Certificate implementation.
Definition: x509_certificate.h:235
X509Certificate(const ByteArrayPtr &raw_data, const String &password)
Constructor.
X509Certificate(const ByteArrayPtr &raw_data, const SecureStringPtr &password)
Constructor.
static SharedPtr< X509Certificate > CreateFromSignedFile(const String &filename)
Creates sertificate from the specified signed file.
ByteArrayPtr GetRawPublicKey() const
static SharedPtr< X509Certificate > CreateFromCertFile(const String &filename)
Creates sertificate from the specified PKCS7 file.
X509Certificate(const String &filename, const SecureStringPtr &password)
Constructor.
DateTime GetNotAfter() const
X509Certificate()
Constructor.
virtual ByteArrayPtr GetRawCertData() const
Gets raw data from certificate as array of bytes.
X509Certificate(const String &filename, const String &password, X509KeyStorageFlags key_storage_flags)
Constructor.
ByteArrayPtr GetRawSerialNumber() const
X509Certificate(const String &filename, const SecureStringPtr &password, X509KeyStorageFlags key_storage_flags)
Constructor.
virtual String GetRawCertDataString() const
Gets raw data from certificate as a hexadecimal string.
virtual String GetSerialNumberString() const
Gets serial number from certificate as a hexadecimal string.
X509Certificate(const String &filename)
Constructor.
virtual ByteArrayPtr GetKeyAlgorithmParameters() const
Gets key information for the current certificate as an array of bytes.
DateTime GetNotBefore() const
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
X509ContentType
Format of X.509 certificate.
Definition: x509_content_type.h:10
X509KeyStorageFlags
Defines how to store key.
Definition: x509_key_storage_flags.h:12
Definition: db_command.h:9
String representing the name of a hash algorithm. This type should be allocated on stack and passed t...
Definition: hash_algorithm_name.h:13