Search in sources :

Example 36 with DerOutputStream

use of sun.security.util.DerOutputStream in project jdk8u_jdk by JetBrains.

the class AuthorityInfoAccessExtension method encodeThis.

// Encode this extension value
private void encodeThis() throws IOException {
    if (accessDescriptions.isEmpty()) {
        this.extensionValue = null;
    } else {
        DerOutputStream ads = new DerOutputStream();
        for (AccessDescription accessDescription : accessDescriptions) {
            accessDescription.encode(ads);
        }
        DerOutputStream seq = new DerOutputStream();
        seq.write(DerValue.tag_Sequence, ads);
        this.extensionValue = seq.toByteArray();
    }
}
Also used : DerOutputStream(sun.security.util.DerOutputStream)

Example 37 with DerOutputStream

use of sun.security.util.DerOutputStream in project jdk8u_jdk by JetBrains.

the class CertificateIssuerExtension method encodeThis.

/**
     * Encode this extension
     */
private void encodeThis() throws IOException {
    if (names == null || names.isEmpty()) {
        this.extensionValue = null;
        return;
    }
    DerOutputStream os = new DerOutputStream();
    names.encode(os);
    this.extensionValue = os.toByteArray();
}
Also used : DerOutputStream(sun.security.util.DerOutputStream)

Example 38 with DerOutputStream

use of sun.security.util.DerOutputStream in project jdk8u_jdk by JetBrains.

the class PolicyInformation method encode.

/**
     * Write the PolicyInformation to the DerOutputStream.
     *
     * @param out the DerOutputStream to write the extension to.
     * @exception IOException on encoding errors.
     */
public void encode(DerOutputStream out) throws IOException {
    DerOutputStream tmp = new DerOutputStream();
    policyIdentifier.encode(tmp);
    if (!policyQualifiers.isEmpty()) {
        DerOutputStream tmp2 = new DerOutputStream();
        for (PolicyQualifierInfo pq : policyQualifiers) {
            tmp2.write(pq.getEncoded());
        }
        tmp.write(DerValue.tag_Sequence, tmp2);
    }
    out.write(DerValue.tag_Sequence, tmp);
}
Also used : DerOutputStream(sun.security.util.DerOutputStream) PolicyQualifierInfo(java.security.cert.PolicyQualifierInfo)

Example 39 with DerOutputStream

use of sun.security.util.DerOutputStream in project jdk8u_jdk by JetBrains.

the class SubjectInfoAccessExtension method encode.

/**
     * Write the extension to the DerOutputStream.
     *
     * @param out the DerOutputStream to write the extension to.
     * @exception IOException on encoding errors.
     */
public void encode(OutputStream out) throws IOException {
    DerOutputStream tmp = new DerOutputStream();
    if (this.extensionValue == null) {
        this.extensionId = PKIXExtensions.SubjectInfoAccess_Id;
        this.critical = false;
        encodeThis();
    }
    super.encode(tmp);
    out.write(tmp.toByteArray());
}
Also used : DerOutputStream(sun.security.util.DerOutputStream)

Example 40 with DerOutputStream

use of sun.security.util.DerOutputStream in project jdk8u_jdk by JetBrains.

the class IssuingDistributionPointExtension method encode.

/**
     * Encodes the issuing distribution point extension and writes it to the
     * DerOutputStream.
     *
     * @param out the output stream.
     * @exception IOException on encoding error.
     */
public void encode(OutputStream out) throws IOException {
    DerOutputStream tmp = new DerOutputStream();
    if (this.extensionValue == null) {
        this.extensionId = PKIXExtensions.IssuingDistributionPoint_Id;
        this.critical = false;
        encodeThis();
    }
    super.encode(tmp);
    out.write(tmp.toByteArray());
}
Also used : DerOutputStream(sun.security.util.DerOutputStream)

Aggregations

DerOutputStream (sun.security.util.DerOutputStream)79 IOException (java.io.IOException)9 DerValue (sun.security.util.DerValue)8 ObjectIdentifier (sun.security.util.ObjectIdentifier)6 CertificateException (java.security.cert.CertificateException)5 BitArray (sun.security.util.BitArray)5 X509Certificate (java.security.cert.X509Certificate)4 AlgorithmId (sun.security.x509.AlgorithmId)4 KeyStoreException (java.security.KeyStoreException)3 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)3 UnrecoverableEntryException (java.security.UnrecoverableEntryException)3 UnrecoverableKeyException (java.security.UnrecoverableKeyException)3 CertificateEncodingException (java.security.cert.CertificateEncodingException)3 Date (java.util.Date)3 SecretKey (javax.crypto.SecretKey)3 DestroyFailedException (javax.security.auth.DestroyFailedException)3 ContentInfo (sun.security.pkcs.ContentInfo)3 DerInputStream (sun.security.util.DerInputStream)3 PolicyQualifierInfo (java.security.cert.PolicyQualifierInfo)2 X509CertSelector (java.security.cert.X509CertSelector)2