Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Security.​Cryptography.​X509Certificates.​X509BasicConstraintsExtension

Assembly: System.Security.Cryptography

Inheritance: object → AsnEncodedDataX509Extension → X509BasicConstraintsExtension

Defines the constraints set on a certificate. This class cannot be inherited.

Properties

public bool
CertificateAuthority
Gets a value indicating whether a certificate is a certificate authority (CA) certificate.
public bool
HasPathLengthConstraint
Gets a value indicating whether a certificate has a restriction on the number of path levels it allows.
public int
PathLengthConstraint
Gets the number of levels allowed in a certificate's path.
public bool
Critical
Gets a Boolean value indicating whether the extension is critical.
public Oid
Oid
Gets or sets the <see cref="T:System.Security.Cryptography.Oid" /> value for an <see cref="T:System.Security.Cryptography.AsnEncodedData" /> object.
public byte[]
RawData
Gets or sets the Abstract Syntax Notation One (ASN.1)-encoded data represented in a byte array.

Methods

public void
CopyFrom​(AsnEncodedData asnEncodedData)
Initializes a new instance of the <see cref="T:System.Security.Cryptography.X509Certificates.X509BasicConstraintsExtension" /> class using an <see cref="T:System.Security.Cryptography.AsnEncodedData" /> object.
asnEncodedData The encoded data to use to create the extension.
CreateForCertificateAuthority​(int? pathLengthConstraint = null)
Creates an instance of <see cref="T:System.Security.Cryptography.X509Certificates.X509BasicConstraintsExtension" /> appropriate for a certificate authority, optionally including a path length constraint value.
Returns The configured basic constraints extension.
pathLengthConstraint The longest valid length of a certificate chain between the certificate containing this extension and an end-entity certificate. The default is <see langword="null" /> , an unconstrained length.
CreateForEndEntity​(bool critical = false)
Creates an instance of <see cref="T:System.Security.Cryptography.X509Certificates.X509BasicConstraintsExtension" /> appropriate for an end-entity certificate, optionally marking the extension as critical.
Returns The configured basic constraints extension.
critical <see langword="true" /> to mark the extension as critical; <see langword="false" /> otherwise. The default is <see langword="false" /> .
public string
Format​(bool multiLine)
Inherited from AsnEncodedData
Returns a formatted version of the Abstract Syntax Notation One (ASN.1)-encoded data as a string.
Returns A formatted string that represents the Abstract Syntax Notation One (ASN.1)-encoded data.
multiLine <see langword="true" /> if the return string should contain carriage returns; otherwise, <see langword="false" /> .
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object