Class CpX509AuthorityKeyIdentifierExtension
Represents the Authority Key Identifier X.509 Extension (2.5.29.35).
Inherited Members
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 |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
CryptographicException |
|
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 |
Exceptions
Type | Condition |
---|---|
CryptographicException |
|
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 nodirectoryName
values. - The
authorityCertIssuer
value contains multipledirectoryName
values. -
The
directoryName
value did not successfully decode as an CpX500DistinguishedName.
See Also
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 |
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
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 |
|
ArgumentException |
|
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 |
|
ArgumentException |
|
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 |
|
CryptographicException |
|
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 |
|
ArgumentException |
|
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 |
|
ArgumentException |
|
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 |
|
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 |
|
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. |