X509Certificate

X509Certificate class

X.509 v.3 certificate. Encrypted certificates are not supported. Only X509KeyStorageFlags::DefaultKeySet flag is supported. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

class X509Certificate : public virtual System::Object,
                        public System::IDisposable

Methods

MethodDescription
static SharedPtr<X509Certificate> CreateFromCertFile(const String&)Creates sertificate from the specified PKCS7 file.
static SharedPtr<X509Certificate> CreateFromSignedFile(const String&)Creates sertificate from the specified signed file.
void Dispose() overrideDoes nothing.
bool Equals(SharedPtr<Object>) overrideCompares two certificates.
virtual bool Equals(ptr)Compares objects using C# Object.Equals semantics.
static std::enable_if<IsSmartPtr<T1>::value&&IsSmartPtr<T2>::value, bool>::type Equals(T1 const&, T2 const&)Compares reference type objects in C# style.
static bool Equals(float const&, float const&)Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.
static bool Equals(double const&, double const&)Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.
virtual ByteArrayPtr Export(X509ContentType) constExports the current object to a byte array using the specified format. NOT IMPLEMENTED.
virtual ByteArrayPtr Export(X509ContentType, const SecureStringPtr&) constExports the current object to a byte array using the specified format. NOT IMPLEMENTED.
virtual ByteArrayPtr Export(X509ContentType, const String&) constExports the current object to a byte array using the specified format. NOT IMPLEMENTED.
virtual bool FastCast(const Details::FastRttiBase&, void **) constFor internal purposes only.
IntPtr get_Handle() constGets a handle to Microsoft Cryptographic API certificate context.
String get_Issuer() constGets name of the certificate authority that issued the X.509v3 certificate.
String get_Subject() constGets subject distinguished name from certificate.
virtual ByteArrayPtr GetCertHash() constGets hash for the current object as an array of bytes.
virtual ByteArrayPtr GetCertHash(const HashAlgorithmName&) constGets hash for the current object as an array of bytes.
virtual String GetCertHashString() constGets SHA1 hash for the current object as a hexadecimal string.
virtual String GetCertHashString(const HashAlgorithmName&) constGets SHA1 hash for the current object as a hexadecimal string.
Detail::SmartPtrCounter * GetCounter()Gets reference counter data structure associated with the object.
virtual String GetEffectiveDateString() constGets effective date of the current sertificate.
virtual String GetExpirationDateString() constGets expiration date of the current sertificate.
virtual String GetFormat() constGets name of the certificate format.
int32_t GetHashCode() const overrideGets certificate hash code.
virtual String GetIssuerName() constGets name of the certification authority that issued the current certificate.
virtual String GetKeyAlgorithm() constGets key information for the current certificate as a string.
virtual ByteArrayPtr GetKeyAlgorithmParameters() constGets key information for the current certificate as an array of bytes.
virtual String GetKeyAlgorithmParametersString() constGets key information for the current certificate as a hexadecimal string.
virtual String GetName() constGets name of the principal to witch the current sertificate was issued.
virtual ByteArrayPtr GetPublicKey() constGets public key from certificate as array of bytes.
virtual String GetPublicKeyString() constGets public key from certificate as a hexadecimal string.
virtual ByteArrayPtr GetRawCertData() constGets raw data from certificate as array of bytes.
virtual String GetRawCertDataString() constGets raw data from certificate as a hexadecimal string.
virtual ByteArrayPtr GetSerialNumber() constGets serial number from certificate as array of bytes.
virtual String GetSerialNumberString() constGets serial number from certificate as a hexadecimal string.
virtual const TypeInfo& GetType() constGets actual type of object. Analog of C# System.Object.GetType() call.
virtual void Import(const String&, const SecureStringPtr&, X509KeyStorageFlags)Imports information from the specified certificate file. NOT IMPLEMENTED.
virtual void Import(const String&, const String&, X509KeyStorageFlags)Imports information from the specified certificate file. NOT IMPLEMENTED.
virtual void Import(const ByteArrayPtr&, const SecureStringPtr&, X509KeyStorageFlags)Imports information from the specified certificate data. NOT IMPLEMENTED.
virtual void Import(const ByteArrayPtr&, const String&, X509KeyStorageFlags)Imports information from the specified certificate data. NOT IMPLEMENTED.
virtual void Import(const String&)Imports information from the specified certificate file. NOT IMPLEMENTED.
virtual void Import(const ByteArrayPtr&)Imports information from the specified certificate data. NOT IMPLEMENTED.
virtual bool Is(const TypeInfo&) constCheck if object represents an instance of type described by targetType. Analog of C# ‘is’ operator.
void Lock()Implements C# lock() statement locking. Call directly or use LockContext sentry object.
virtual ptr MemberwiseClone() constAnalog of C# Object.MemberwiseClone() method. Enables cloning custom types.
Object()Creates object. Initializes all internal data structures.
Object(Object const&)Copy constructor. Doesn’t copy anything, really, just initializes new object and enables copy constructing subclasses.
X509Certificate& operator=(const X509Certificate&)
Object& operator=(Object const&)Assignment operator. Doesn’t copy anything, really, just initializes new object and enables copy constructing subclasses.
static bool ReferenceEquals(ptr const&, ptr const&)Compares objects by reference.
static std::enable_if<!IsSmartPtr<T>::value, bool>::type ReferenceEquals(T const&, T const&)Compares objects by reference.
static std::enable_if<!IsSmartPtr<T>::value, bool>::type ReferenceEquals(T const&, std::nullptr_t)Reference-compares value type object with nullptr.
bool ReferenceEquals(String const&, std::nullptr_t)Specialization of Object::ReferenceEquals for case of string and nullptr.
bool ReferenceEquals(String const&, String const&)Specialization of Object::ReferenceEquals for case of strings.
int RemovedSharedRefs(int)Decreases shared reference count by specified value.
virtual void Reset()Resets the certificate state.
virtual void SetTemplateWeakPtr(uint32_t)Set n’th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode.
int SharedCount() constGets current value of shared reference counter.
Object * SharedRefAdded()Increments shared reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
int SharedRefRemovedSafe()Decrements and returns shared reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
virtual String ToString(bool) constReturns the certificate information in text format.
String ToString() const overrideReturns the certificate information in text format.
static const TypeInfo& Type()Implements C# typeof(System.Object) construct.
void Unlock()Implements C# lock() statement unlocking. Call directly or use LockContext sentry object.
Detail::SmartPtrCounter * WeakRefAdded()Increments weak reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
void WeakRefRemoved()Decrements weak reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
X509Certificate(const X509Certificate&)
X509Certificate()Constructor.
X509Certificate(const ByteArrayPtr&)Constructor.
X509Certificate(const String&)Constructor.
X509Certificate(const SharedPtr<X509Certificate>&)Constructor.
X509Certificate(const ByteArrayPtr&, const String&)Constructor.
X509Certificate(const ByteArrayPtr&, const SecureStringPtr&)Constructor.
X509Certificate(const String&, const String&)Constructor.
X509Certificate(const String&, const SecureStringPtr&)Constructor.
X509Certificate(const ByteArrayPtr&, const String&, X509KeyStorageFlags)Constructor.
X509Certificate(const ByteArrayPtr&, const SecureStringPtr&, X509KeyStorageFlags)Constructor.
X509Certificate(const String&, const String&, X509KeyStorageFlags)Constructor.
X509Certificate(const String&, const SecureStringPtr&, X509KeyStorageFlags)Constructor.
X509Certificate(const ByteArrayPtr&, const ByteArrayPtr&, X509KeyStorageFlags)Constructor.
virtual ~Object()Destroys object. Frees all internal data structures.

Typedefs

TypedefDescription
PtrPointer type.

See Also