4#include <system/string.h>
5#include <system/date_time.h>
6#include <system/exceptions.h>
7#include <system/security/secure_string.h>
8#include <security/cryptography/asymmetric_algorithm.h>
9#include <security/cryptography/oid.h>
10#include <security/cryptography/x509_certificates/public_key.h>
11#include <security/cryptography/x509_certificates/x509_certificate.h>
12#include <security/cryptography/x509_certificates/x509_name_type.h>
13#include <security/cryptography/x509_certificates/x509_key_storage_flags.h>
14#include <security/cryptography/x509_certificates/x509_extension_collection.h>
15#include <security/cryptography/x509_certificates/x500_distinguished_name.h>
17namespace System {
namespace Security {
namespace Cryptography {
25namespace System {
namespace Security {
namespace Cryptography {
namespace X509Certificates {
151 ASPOSECPP_SHARED_API
bool Verify()
const;
153 ASPOSECPP_SHARED_API
void Reset()
override;
Represents a specific date and time value on the time continuum. This type should be allocated on sta...
Definition: date_time.h:50
Represents X509 certificate. Objects of this class should only be allocated using System::MakeObject(...
Definition: x509_certificate_2.h:32
void Reset() override
Resets the certificate state.
void Import(const ByteArrayPtr &data, const String &password, X509KeyStorageFlags key_storage_flags) override
Imports information from the specified certificate data.
SharedPtr< DSA > GetDSAPrivateKey() const
Gets RSA private key;.
X509ExtensionCollectionPtr get_Extensions() const
Gets collection of extension objects associated with certificate.
void set_FriendlyName(const String &value)
Sets the certificate's friendly name.
static X509ContentType GetCertContentType(const ByteArrayPtr &raw_data)
Gets the type of certificate contained in the specified byte array.
SharedPtr< X500DistinguishedName > get_SubjectName() const
Gets the subject name from a certificate.
X509Certificate2(const ByteArrayPtr &raw_data)
Constructor.
X509Certificate2(const ByteArrayPtr &raw_data, const SecureStringPtr &password)
Constructor.
bool get_HasPrivateKey() const
Checks whether the certificate has private key.
void Import(const String &filename, const String &password, X509KeyStorageFlags key_storage_flags) override
Imports information from the specified certificate file.
SharedPtr< ECDsa > GetECDsaPrivateKey() const
Gets RSA private key;.
void set_Archived(bool value) const
Sets a value indicating that certificate is archived.
SharedPtr< Oid > get_SignatureAlgorithm() const
Gets algorithm used to create signature of a certificate.
bool get_Archived() const
Gets a value indicating that certificate is archived.
ByteArrayPtr get_RawData() const
Gets certificate raw data.
SharedPtr< AsymmetricAlgorithm > get_PrivateKey() const
Gets private key associated with certificate.
bool Verify() const
Verifies certificate chain.
X509Certificate2(const ByteArrayPtr &raw_data, const String &password)
Constructor.
void Import(const String &filename) override
Imports information from the specified certificate file.
String get_SerialNumber() const
Gets the serial number of a certificate.
X509Certificate2(const String &filename, const String &password, X509KeyStorageFlags key_storage_flags)
Constructor.
SharedPtr< DSA > GetDSAPublicKey() const
Gets RSA public key.
static X509ContentType GetCertContentType(const String &filename)
Gets the type of certificate contained in the specified file.
SharedPtr< PublicKey > get_PublicKey() const
Gets a sertificate PublicKey object.
X509Certificate2(const SharedPtr< X509Certificate > &cert)
Constructor.
X509Certificate2(const String &filename, const String &password)
Constructor.
DateTime get_NotBefore() const
Gets the local date and time on which a certificate becomes valid.
SharedPtr< RSA > GetRSAPrivateKey() const
Gets RSA private key;.
String ToString(bool verbose) const override
Returns the certificate information in text format.
void set_PrivateKey(const SharedPtr< AsymmetricAlgorithm > &value)
Sets or clears private key associated with certificate.
void Import(const ByteArrayPtr &data, const SecureStringPtr &password, X509KeyStorageFlags key_storage_flags) override
Imports information from the specified certificate data.
int32_t get_Version() const
Gets certificate format version.
void Import(const ByteArrayPtr &data) override
Imports information from the specified certificate data.
SharedPtr< ECDsa > GetECDsaPublicKey() const
Gets RSA public key.
X509Certificate2(const ByteArrayPtr &raw_data, const ByteArrayPtr &private_key, X509KeyStorageFlags key_storage_flags)
Constructor.
void Import(const String &filename, const SecureStringPtr &password, X509KeyStorageFlags key_storage_flags) override
Imports information from the specified certificate file.
X509Certificate2(const String &filename)
Constructor.
DateTime get_NotAfter() const
Gets the local date and time after which a certificate is no longer valid.
String get_FriendlyName() const
Gets the certificate's friendly name.
X509Certificate2(const String &filename, const SecureStringPtr &password, X509KeyStorageFlags key_storage_flags)
Constructor.
SharedPtr< X500DistinguishedName > get_IssuerName() const
Gets the name of party that issued a certificate.
String get_Thumbprint() const
Gets the certificate thumbprint.
String ToString() const override
Returns the certificate information in text format.
X509Certificate2(const ByteArrayPtr &raw_data, const String &password, X509KeyStorageFlags key_storage_flags)
Constructor.
String GetNameInfo(X509NameType name_type, bool for_issuer) const
Gets subject or issuer name from certificate.
SharedPtr< RSA > GetRSAPublicKey() const
Gets RSA public key.
X509Certificate2(const String &filename, const SecureStringPtr &password)
Constructor.
X509Certificate2(const ByteArrayPtr &raw_data, const SecureStringPtr &password, X509KeyStorageFlags key_storage_flags)
Constructor.
X509Certificate2()
Constructs empty X509Certificate2.
X.509 v.3 certificate. Encrypted certificates are not supported. Only X509KeyStorageFlags::DefaultKey...
Definition: x509_certificate.h:29
Pointer to collection of X509 extensions. This type is a pointer to manage other object's deletion....
Definition: x509_extension_collection.h:69
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
X509NameType
Type of X.509 certificate-contained name which relates to either issuer or subject of the certificate...
Definition: x509_name_type.h:8
X509KeyStorageFlags
Defines how to store key.
Definition: x509_key_storage_flags.h:12
Definition: db_command.h:9