Search in sources :

Example 11 with NameConstraints

use of com.android.org.bouncycastle.asn1.x509.NameConstraints in project keystore-explorer by kaikramer.

the class DNameConstraints method okPressed.

private void okPressed() {
    List<GeneralSubtree> permittedSubtrees = jgsPermittedSubtrees.getGeneralSubtrees().getGeneralSubtrees();
    List<GeneralSubtree> excludedSubtrees = jgsExcludedSubtrees.getGeneralSubtrees().getGeneralSubtrees();
    GeneralSubtree[] permittedSubtreesArray = permittedSubtrees.toArray(new GeneralSubtree[permittedSubtrees.size()]);
    GeneralSubtree[] excludedSubtreesArray = excludedSubtrees.toArray(new GeneralSubtree[excludedSubtrees.size()]);
    NameConstraints nameConstraints = new NameConstraints(permittedSubtreesArray, excludedSubtreesArray);
    try {
        value = nameConstraints.getEncoded(ASN1Encoding.DER);
    } catch (IOException ex) {
        DError dError = new DError(this, ex);
        dError.setLocationRelativeTo(this);
        dError.setVisible(true);
        return;
    }
    closeDialog();
}
Also used : NameConstraints(org.bouncycastle.asn1.x509.NameConstraints) GeneralSubtree(org.bouncycastle.asn1.x509.GeneralSubtree) IOException(java.io.IOException) DError(org.kse.gui.error.DError)

Aggregations

GeneralSubtree (org.bouncycastle.asn1.x509.GeneralSubtree)6 NameConstraints (org.bouncycastle.asn1.x509.NameConstraints)6 IOException (java.io.IOException)5 ArrayList (java.util.ArrayList)5 List (java.util.List)5 Date (java.util.Date)4 X509Certificate (java.security.cert.X509Certificate)3 ASN1Sequence (org.bouncycastle.asn1.ASN1Sequence)3 BigInteger (java.math.BigInteger)2 GeneralSecurityException (java.security.GeneralSecurityException)2 CertPathBuilderException (java.security.cert.CertPathBuilderException)2 CertPathValidatorException (java.security.cert.CertPathValidatorException)2 CertificateExpiredException (java.security.cert.CertificateExpiredException)2 CertificateNotYetValidException (java.security.cert.CertificateNotYetValidException)2 HashSet (java.util.HashSet)2 AlgorithmIdentifier (org.apache.harmony.security.x509.AlgorithmIdentifier)2 GeneralName (org.apache.harmony.security.x509.GeneralName)2 NameConstraints (org.apache.harmony.security.x509.NameConstraints)2 PolicyInformation (org.apache.harmony.security.x509.PolicyInformation)2 PrivateKeyUsagePeriod (org.apache.harmony.security.x509.PrivateKeyUsagePeriod)2