КриптоПро .NET
Search Results for

    Показать/Скрыть содержание

    Class CpX509Certificate

    Inheritance
    object
    CpX509Certificate
    CpX509Certificate2
    Implements
    IDisposable
    IDeserializationCallback
    ISerializable
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: CryptoPro.Security.Cryptography.X509Certificates
    Assembly: CryptoPro.Security.Cryptography.dll
    Syntax
    public class CpX509Certificate : IDisposable, IDeserializationCallback, ISerializable

    Constructors

    CpX509Certificate()

    Declaration
    [Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId = "SYSLIB0026", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
    public CpX509Certificate()

    CpX509Certificate(CpX509Certificate)

    Declaration
    public CpX509Certificate(CpX509Certificate cert)
    Parameters
    Type Name Description
    CpX509Certificate cert

    CpX509Certificate(byte[])

    Declaration
    public CpX509Certificate(byte[] data)
    Parameters
    Type Name Description
    byte[] data

    CpX509Certificate(byte[], SecureString?)

    Declaration
    [CLSCompliant(false)]
    public CpX509Certificate(byte[] rawData, SecureString? password)
    Parameters
    Type Name Description
    byte[] rawData
    SecureString password

    CpX509Certificate(byte[], SecureString?, X509KeyStorageFlags)

    Declaration
    [CLSCompliant(false)]
    public CpX509Certificate(byte[] rawData, SecureString? password, X509KeyStorageFlags keyStorageFlags)
    Parameters
    Type Name Description
    byte[] rawData
    SecureString password
    X509KeyStorageFlags keyStorageFlags

    CpX509Certificate(byte[], string?)

    Declaration
    public CpX509Certificate(byte[] rawData, string? password)
    Parameters
    Type Name Description
    byte[] rawData
    string password

    CpX509Certificate(byte[], string?, X509KeyStorageFlags)

    Declaration
    public CpX509Certificate(byte[] rawData, string? password, X509KeyStorageFlags keyStorageFlags)
    Parameters
    Type Name Description
    byte[] rawData
    string password
    X509KeyStorageFlags keyStorageFlags

    CpX509Certificate(nint)

    Declaration
    public CpX509Certificate(nint handle)
    Parameters
    Type Name Description
    nint handle

    CpX509Certificate(string)

    Declaration
    public CpX509Certificate(string fileName)
    Parameters
    Type Name Description
    string fileName

    CpX509Certificate(string, SecureString?)

    Declaration
    [CLSCompliant(false)]
    public CpX509Certificate(string fileName, SecureString? password)
    Parameters
    Type Name Description
    string fileName
    SecureString password

    CpX509Certificate(string, SecureString?, X509KeyStorageFlags)

    Declaration
    [CLSCompliant(false)]
    public CpX509Certificate(string fileName, SecureString? password, X509KeyStorageFlags keyStorageFlags)
    Parameters
    Type Name Description
    string fileName
    SecureString password
    X509KeyStorageFlags keyStorageFlags

    CpX509Certificate(string, string?)

    Declaration
    public CpX509Certificate(string fileName, string? password)
    Parameters
    Type Name Description
    string fileName
    string password

    CpX509Certificate(string, string?, X509KeyStorageFlags)

    Declaration
    public CpX509Certificate(string fileName, string? password, X509KeyStorageFlags keyStorageFlags)
    Parameters
    Type Name Description
    string fileName
    string password
    X509KeyStorageFlags keyStorageFlags

    Properties

    Handle

    Declaration
    public nint Handle { get; }
    Property Value
    Type Description
    nint

    Issuer

    Declaration
    public string Issuer { get; }
    Property Value
    Type Description
    string

    SerialNumberBytes

    Gets a value whose contents represent the big-endian representation of the certificate's serial number.

    Declaration
    public ReadOnlyMemory<byte> SerialNumberBytes { get; }
    Property Value
    Type Description
    ReadOnlyMemory<byte>

    The big-endian representation of the certificate's serial number.

    Subject

    Declaration
    public string Subject { get; }
    Property Value
    Type Description
    string

    Methods

    CreateFromCertFile(string)

    Declaration
    public static CpX509Certificate CreateFromCertFile(string filename)
    Parameters
    Type Name Description
    string filename
    Returns
    Type Description
    CpX509Certificate

    CreateFromSignedFile(string)

    Declaration
    public static CpX509Certificate CreateFromSignedFile(string filename)
    Parameters
    Type Name Description
    string filename
    Returns
    Type Description
    CpX509Certificate

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()

    Dispose(bool)

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    Equals(CpX509Certificate?)

    Declaration
    public virtual bool Equals(CpX509Certificate? other)
    Parameters
    Type Name Description
    CpX509Certificate other
    Returns
    Type Description
    bool

    Equals(object?)

    Determines whether the specified object is equal to the current object.

    Declaration
    public override bool Equals(object? obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current object.

    Returns
    Type Description
    bool

    true if the specified object is equal to the current object; otherwise, false.

    Overrides
    object.Equals(object)

    Export(X509ContentType)

    Declaration
    public virtual byte[] Export(X509ContentType contentType)
    Parameters
    Type Name Description
    X509ContentType contentType
    Returns
    Type Description
    byte[]

    Export(X509ContentType, SecureString?)

    Declaration
    [CLSCompliant(false)]
    public virtual byte[] Export(X509ContentType contentType, SecureString? password)
    Parameters
    Type Name Description
    X509ContentType contentType
    SecureString password
    Returns
    Type Description
    byte[]

    Export(X509ContentType, string?)

    Declaration
    public virtual byte[] Export(X509ContentType contentType, string? password)
    Parameters
    Type Name Description
    X509ContentType contentType
    string password
    Returns
    Type Description
    byte[]

    FormatDate(DateTime)

    Convert a date to a string.

    Some cultures, specifically using the Um-AlQura calendar cannot convert dates far into the future into strings. If the expiration date of an X.509 certificate is beyond the range of one of these cases, we need to fall back to a calendar which can express the dates

    Declaration
    protected static string FormatDate(DateTime date)
    Parameters
    Type Name Description
    DateTime date
    Returns
    Type Description
    string

    GetCertHash()

    Declaration
    public virtual byte[] GetCertHash()
    Returns
    Type Description
    byte[]

    GetCertHash(CpHashAlgorithmName)

    Declaration
    public virtual byte[] GetCertHash(CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    CpHashAlgorithmName hashAlgorithm
    Returns
    Type Description
    byte[]

    GetCertHashString()

    Declaration
    public virtual string GetCertHashString()
    Returns
    Type Description
    string

    GetCertHashString(CpHashAlgorithmName)

    Declaration
    public virtual string GetCertHashString(CpHashAlgorithmName hashAlgorithm)
    Parameters
    Type Name Description
    CpHashAlgorithmName hashAlgorithm
    Returns
    Type Description
    string

    GetEffectiveDateString()

    Declaration
    public virtual string GetEffectiveDateString()
    Returns
    Type Description
    string

    GetExpirationDateString()

    Declaration
    public virtual string GetExpirationDateString()
    Returns
    Type Description
    string

    GetFormat()

    Declaration
    public virtual string GetFormat()
    Returns
    Type Description
    string

    GetHashCode()

    Serves as the default hash function.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for the current object.

    Overrides
    object.GetHashCode()

    GetIssuerName()

    Declaration
    [Obsolete("X509Certificate.GetIssuerName has been deprecated. Use the Issuer property instead.")]
    public virtual string GetIssuerName()
    Returns
    Type Description
    string

    GetKeyAlgorithm()

    Declaration
    public virtual string GetKeyAlgorithm()
    Returns
    Type Description
    string

    GetKeyAlgorithmParameters()

    Declaration
    public virtual byte[] GetKeyAlgorithmParameters()
    Returns
    Type Description
    byte[]

    GetKeyAlgorithmParametersString()

    Declaration
    public virtual string GetKeyAlgorithmParametersString()
    Returns
    Type Description
    string

    GetName()

    Declaration
    [Obsolete("X509Certificate.GetName has been deprecated. Use the Subject property instead.")]
    public virtual string GetName()
    Returns
    Type Description
    string

    GetPublicKey()

    Declaration
    public virtual byte[] GetPublicKey()
    Returns
    Type Description
    byte[]

    GetPublicKeyString()

    Declaration
    public virtual string GetPublicKeyString()
    Returns
    Type Description
    string

    GetRawCertData()

    Declaration
    public virtual byte[] GetRawCertData()
    Returns
    Type Description
    byte[]

    GetRawCertDataString()

    Declaration
    public virtual string GetRawCertDataString()
    Returns
    Type Description
    string

    GetSerialNumber()

    Declaration
    public virtual byte[] GetSerialNumber()
    Returns
    Type Description
    byte[]

    GetSerialNumberString()

    Declaration
    public virtual string GetSerialNumberString()
    Returns
    Type Description
    string

    Import(byte[])

    Declaration
    [Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId = "SYSLIB0026", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
    public virtual void Import(byte[] rawData)
    Parameters
    Type Name Description
    byte[] rawData

    Import(byte[], SecureString?, X509KeyStorageFlags)

    Declaration
    [CLSCompliant(false)]
    [Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId = "SYSLIB0026", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
    public virtual void Import(byte[] rawData, SecureString? password, X509KeyStorageFlags keyStorageFlags)
    Parameters
    Type Name Description
    byte[] rawData
    SecureString password
    X509KeyStorageFlags keyStorageFlags

    Import(byte[], string?, X509KeyStorageFlags)

    Declaration
    [Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId = "SYSLIB0026", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
    public virtual void Import(byte[] rawData, string? password, X509KeyStorageFlags keyStorageFlags)
    Parameters
    Type Name Description
    byte[] rawData
    string password
    X509KeyStorageFlags keyStorageFlags

    Import(string)

    Declaration
    [Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId = "SYSLIB0026", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
    public virtual void Import(string fileName)
    Parameters
    Type Name Description
    string fileName

    Import(string, SecureString?, X509KeyStorageFlags)

    Declaration
    [CLSCompliant(false)]
    [Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId = "SYSLIB0026", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
    public virtual void Import(string fileName, SecureString? password, X509KeyStorageFlags keyStorageFlags)
    Parameters
    Type Name Description
    string fileName
    SecureString password
    X509KeyStorageFlags keyStorageFlags

    Import(string, string?, X509KeyStorageFlags)

    Declaration
    [Obsolete("X509Certificate and X509Certificate2 are immutable. Use the appropriate constructor to create a new certificate.", DiagnosticId = "SYSLIB0026", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
    public virtual void Import(string fileName, string? password, X509KeyStorageFlags keyStorageFlags)
    Parameters
    Type Name Description
    string fileName
    string password
    X509KeyStorageFlags keyStorageFlags

    Reset()

    Declaration
    public virtual void Reset()

    ToString()

    Returns a string that represents the current object.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string that represents the current object.

    Overrides
    object.ToString()

    ToString(bool)

    Declaration
    public virtual string ToString(bool fVerbose)
    Parameters
    Type Name Description
    bool fVerbose
    Returns
    Type Description
    string

    TryGetCertHash(CpHashAlgorithmName, Span<byte>, out int)

    Declaration
    public virtual bool TryGetCertHash(CpHashAlgorithmName hashAlgorithm, Span<byte> destination, out int bytesWritten)
    Parameters
    Type Name Description
    CpHashAlgorithmName hashAlgorithm
    Span<byte> destination
    int bytesWritten
    Returns
    Type Description
    bool

    Implements

    IDisposable
    IDeserializationCallback
    ISerializable
    В этом разделе
    Наверх Generated by DocFX