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

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

    Class CpX509AuthorityKeyIdentifierExtension

    Represents the Authority Key Identifier X.509 Extension (2.5.29.35).

    Inheritance
    object
    CpAsnEncodedData
    CpX509Extension
    CpX509AuthorityKeyIdentifierExtension
    Inherited Members
    CpX509Extension.Critical
    CpAsnEncodedData.Oid
    CpAsnEncodedData.RawData
    CpAsnEncodedData.Format(bool)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: CryptoPro.Security.Cryptography.X509Certificates
    Assembly: CryptoPro.Security.Cryptography.dll
    Syntax
    public sealed class CpX509AuthorityKeyIdentifierExtension : CpX509Extension

    Constructors

    CpX509AuthorityKeyIdentifierExtension()

    Initializes a new instance of the CpX509AuthorityKeyIdentifierExtension class.

    Declaration
    public CpX509AuthorityKeyIdentifierExtension()

    CpX509AuthorityKeyIdentifierExtension(byte[], bool)

    Initializes a new instance of the CpX509AuthorityKeyIdentifierExtension class from an encoded representation of the extension and an optional critical marker.

    Declaration
    public CpX509AuthorityKeyIdentifierExtension(byte[] rawData, bool critical = false)
    Parameters
    Type Name Description
    byte[] rawData

    The encoded data used to create the extension.

    bool critical

    true if the extension is critical; otherwise, false.

    Exceptions
    Type Condition
    ArgumentNullException

    rawData is null.

    CryptographicException

    rawData did not decode as an Authority Key Identifier extension.

    CpX509AuthorityKeyIdentifierExtension(ReadOnlySpan<byte>, bool)

    Initializes a new instance of the CpX509AuthorityKeyIdentifierExtension class from an encoded representation of the extension and an optional critical marker.

    Declaration
    public CpX509AuthorityKeyIdentifierExtension(ReadOnlySpan<byte> rawData, bool critical = false)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> rawData

    The encoded data used to create the extension.

    bool critical

    true if the extension is critical; otherwise, false.

    Exceptions
    Type Condition
    CryptographicException

    rawData did not decode as an Authority Key Identifier extension.

    Properties

    KeyIdentifier

    Gets a value whose contents represent the subject key identifier value from this certificate's issuing Certificate Authority (CA), when specified.

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

    The subject key identifier from this certificate's issuing Certificate Authority (CA).

    NamedIssuer

    Gets the IssuerName value from this certificate's issuing Certificate Authority (CA), when available.

    Declaration
    public CpX500DistinguishedName? NamedIssuer { get; }
    Property Value
    Type Description
    CpX500DistinguishedName

    The IssuerName value from this certificate's issuing Certificate Authority (CA).

    Remarks

    This property is null if any of the following are true:

    • The encoded extension does not include an authorityCertIssuer value.
    • The authorityCertIssuer value contains no directoryName values.
    • The authorityCertIssuer value contains multiple directoryName values.
    • The directoryName value did not successfully decode as an CpX500DistinguishedName.
    See Also
    RawIssuer

    RawIssuer

    Gets a value whose contents represent the encoded representation of the authorityCertIssuer field from the extension, or null when the extension does not contain an authority certificate issuer field.

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

    The encoded authorityCertIssuer value.

    SerialNumber

    Gets a value whose contents represent the serial number of this certificate's issuing Certificate Authority (CA).

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

    The serial number from this certificate's issuing Certificate Authority (CA).

    Methods

    CopyFrom(CpAsnEncodedData)

    Copies information from an CpAsnEncodedData object.

    Declaration
    public override void CopyFrom(CpAsnEncodedData asnEncodedData)
    Parameters
    Type Name Description
    CpAsnEncodedData asnEncodedData

    The CpAsnEncodedData object to base the new object on.

    Overrides
    CpX509Extension.CopyFrom(CpAsnEncodedData)

    Create(byte[], CpX500DistinguishedName, byte[])

    Creates an CpX509AuthorityKeyIdentifierExtension that specifies the provided key identifier, issuer name and serial number.

    Declaration
    public static CpX509AuthorityKeyIdentifierExtension Create(byte[] keyIdentifier, CpX500DistinguishedName issuerName, byte[] serialNumber)
    Parameters
    Type Name Description
    byte[] keyIdentifier

    The subject key identifier value from the Certificate Authority (CA) certificate that will sign this extension.

    CpX500DistinguishedName issuerName

    The issuer name value from the Certificate Authority (CA) certificate that will sign this extension.

    byte[] serialNumber

    The serial number value from the Certificate Authority (CA) certificate that will sign this extension.

    Returns
    Type Description
    CpX509AuthorityKeyIdentifierExtension

    The configured extension.

    Exceptions
    Type Condition
    ArgumentNullException

    keyIdentifier, issuerName or serialNumber is null.

    ArgumentException

    serialNumber is invalid because the leading 9 bits are either all zero or all one.

    Create(ReadOnlySpan<byte>, CpX500DistinguishedName, ReadOnlySpan<byte>)

    Creates an CpX509AuthorityKeyIdentifierExtension that specifies the provided key identifier, issuer name and serial number.

    Declaration
    public static CpX509AuthorityKeyIdentifierExtension Create(ReadOnlySpan<byte> keyIdentifier, CpX500DistinguishedName issuerName, ReadOnlySpan<byte> serialNumber)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> keyIdentifier

    The subject key identifier value from the Certificate Authority (CA) certificate that will sign this extension.

    CpX500DistinguishedName issuerName

    The issuer name value from the Certificate Authority (CA) certificate that will sign this extension.

    ReadOnlySpan<byte> serialNumber

    The serial number value from the Certificate Authority (CA) certificate that will sign this extension.

    Returns
    Type Description
    CpX509AuthorityKeyIdentifierExtension

    The configured extension.

    Exceptions
    Type Condition
    ArgumentNullException

    issuerName is null.

    ArgumentException

    serialNumber is invalid because the leading 9 bits are either all zero or all one.

    CreateFromCertificate(CpX509Certificate2, bool, bool)

    Creates an CpX509AuthorityKeyIdentifierExtension based on values from the provided certificate.

    Declaration
    public static CpX509AuthorityKeyIdentifierExtension CreateFromCertificate(CpX509Certificate2 certificate, bool includeKeyIdentifier, bool includeIssuerAndSerial)
    Parameters
    Type Name Description
    CpX509Certificate2 certificate

    The Certificate Authority (CA) certificate that will sign this extension.

    bool includeKeyIdentifier

    true to include the Subject Key Identifier value from the certificate as the key identifier value in this extension; otherwise, false.

    bool includeIssuerAndSerial

    true to include the certificate's issuer name and serial number in this extension; otherwise, false.

    Returns
    Type Description
    CpX509AuthorityKeyIdentifierExtension

    The configured extension.

    Exceptions
    Type Condition
    ArgumentNullException

    certificate is null.

    CryptographicException

    includeKeyIdentifier is true, but certificate does not contain a Subject Key Identifier extension.

    CreateFromIssuerNameAndSerialNumber(CpX500DistinguishedName, byte[])

    Creates an CpX509AuthorityKeyIdentifierExtension that specifies the provided issuer name and serial number.

    Declaration
    public static CpX509AuthorityKeyIdentifierExtension CreateFromIssuerNameAndSerialNumber(CpX500DistinguishedName issuerName, byte[] serialNumber)
    Parameters
    Type Name Description
    CpX500DistinguishedName issuerName

    The issuer name value from the Certificate Authority (CA) certificate that will sign this extension.

    byte[] serialNumber

    The serial number value from the Certificate Authority (CA) certificate that will sign this extension.

    Returns
    Type Description
    CpX509AuthorityKeyIdentifierExtension

    The configured extension.

    Exceptions
    Type Condition
    ArgumentNullException

    issuerName or serialNumber is null.

    ArgumentException

    serialNumber is invalid because the leading 9 bits are either all zero or all one.

    CreateFromIssuerNameAndSerialNumber(CpX500DistinguishedName, ReadOnlySpan<byte>)

    Creates an CpX509AuthorityKeyIdentifierExtension that specifies the provided issuer name and serial number.

    Declaration
    public static CpX509AuthorityKeyIdentifierExtension CreateFromIssuerNameAndSerialNumber(CpX500DistinguishedName issuerName, ReadOnlySpan<byte> serialNumber)
    Parameters
    Type Name Description
    CpX500DistinguishedName issuerName

    The issuer name value from the Certificate Authority (CA) certificate that will sign this extension.

    ReadOnlySpan<byte> serialNumber

    The serial number value from the Certificate Authority (CA) certificate that will sign this extension.

    Returns
    Type Description
    CpX509AuthorityKeyIdentifierExtension

    The configured extension.

    Exceptions
    Type Condition
    ArgumentNullException

    issuerName is null.

    ArgumentException

    serialNumber is invalid because the leading 9 bits are either all zero or all one.

    CreateFromSubjectKeyIdentifier(CpX509SubjectKeyIdentifierExtension)

    Creates an CpX509AuthorityKeyIdentifierExtension that specifies the key identifier value from a subject key identifier extension.

    Declaration
    public static CpX509AuthorityKeyIdentifierExtension CreateFromSubjectKeyIdentifier(CpX509SubjectKeyIdentifierExtension subjectKeyIdentifier)
    Parameters
    Type Name Description
    CpX509SubjectKeyIdentifierExtension subjectKeyIdentifier

    The subject key identifier extension from the Certificate Authority (CA) certificate that will sign this extension.

    Returns
    Type Description
    CpX509AuthorityKeyIdentifierExtension

    The configured extension.

    Exceptions
    Type Condition
    ArgumentNullException

    subjectKeyIdentifier is null.

    CreateFromSubjectKeyIdentifier(byte[])

    Creates an CpX509AuthorityKeyIdentifierExtension that specifies the provided key identifier value.

    Declaration
    public static CpX509AuthorityKeyIdentifierExtension CreateFromSubjectKeyIdentifier(byte[] subjectKeyIdentifier)
    Parameters
    Type Name Description
    byte[] subjectKeyIdentifier

    The subject key identifier value from the Certificate Authority (CA) certificate that will sign this extension.

    Returns
    Type Description
    CpX509AuthorityKeyIdentifierExtension

    The configured extension.

    Exceptions
    Type Condition
    ArgumentNullException

    subjectKeyIdentifier is null.

    CreateFromSubjectKeyIdentifier(ReadOnlySpan<byte>)

    Creates an CpX509AuthorityKeyIdentifierExtension that specifies the provided key identifier value.

    Declaration
    public static CpX509AuthorityKeyIdentifierExtension CreateFromSubjectKeyIdentifier(ReadOnlySpan<byte> subjectKeyIdentifier)
    Parameters
    Type Name Description
    ReadOnlySpan<byte> subjectKeyIdentifier

    The subject key identifier value from the Certificate Authority (CA) certificate that will sign this extension.

    Returns
    Type Description
    CpX509AuthorityKeyIdentifierExtension

    The configured extension.

    See Also
    SubjectKeyIdentifierBytes
    В этом разделе
    Наверх Generated by DocFX