Java.Security.Cert.X509CertSelector.SetNameConstraints Method
Sets the criterion for the name constraints.

Syntax

[Android.Runtime.Register("setNameConstraints", "([B)V", "GetSetNameConstraints_arrayBHandler")]
public virtual void SetNameConstraints (byte[] bytes)

Parameters

bytes
the name constraints in ASN.1 DER encoded format, or null to not check any constraints.

Exceptions

TypeReason
Java.IO.IOExceptionif decoding the name constraints fail.

Remarks

Sets the criterion for the name constraints.

The certificate must constraint subject and subject alternative names that match the specified name constraints.

The name constraints in ASN.1:

java Example

 NameConstraints ::= SEQUENCE {
        permittedSubtrees       [0]     GeneralSubtrees OPTIONAL,
        excludedSubtrees        [1]     GeneralSubtrees OPTIONAL }

 GeneralSubtrees ::= SEQUENCE SIZE (1..MAX) OF GeneralSubtree

 GeneralSubtree ::= SEQUENCE {
        base                    GeneralName,
        minimum         [0]     BaseDistance DEFAULT 0,
        maximum         [1]     BaseDistance OPTIONAL }

 BaseDistance ::= INTEGER (0..MAX)

 GeneralName ::= CHOICE {
        otherName                       [0]     OtherName,
        rfc822Name                      [1]     IA5String,
        dNSName                         [2]     IA5String,
        x400Address                     [3]     ORAddress,
        directoryName                   [4]     Name,
        ediPartyName                    [5]     EDIPartyName,
        uniformResourceIdentifier       [6]     IA5String,
        iPAddress                       [7]     OCTET STRING,
        registeredID                    [8]     OBJECT IDENTIFIER}

 

[Android Documentation]

Requirements

Namespace: Java.Security.Cert
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1