Search in sources :

Example 1 with Base64BinaryWithDescType

use of org.xipki.ca.certprofile.x509.jaxb.Base64BinaryWithDescType in project xipki by xipki.

the class ProfileConfCreatorDemo method createSmimeCapabilities.

private static ExtensionValueType createSmimeCapabilities() {
    SMIMECapabilities caps = new SMIMECapabilities();
    // DES-EDE3-CBC
    SMIMECapability cap = new SMIMECapability();
    caps.getSMIMECapability().add(cap);
    cap.setCapabilityID(createOidType(new ASN1ObjectIdentifier("1.2.840.113549.3.7"), "DES-EDE3-CBC"));
    // RC2-CBC keysize 128
    cap = new SMIMECapability();
    caps.getSMIMECapability().add(cap);
    cap.setCapabilityID(createOidType(new ASN1ObjectIdentifier("1.2.840.113549.3.2"), "RC2-CBC"));
    cap.setParameters(new org.xipki.ca.certprofile.x509.jaxb.SMIMECapability.Parameters());
    cap.getParameters().setInteger(BigInteger.valueOf(128));
    // RC2-CBC keysize 64
    cap = new SMIMECapability();
    caps.getSMIMECapability().add(cap);
    cap.setCapabilityID(createOidType(new ASN1ObjectIdentifier("1.2.840.113549.3.2"), "RC2-CBC"));
    cap.setParameters(new org.xipki.ca.certprofile.x509.jaxb.SMIMECapability.Parameters());
    Base64BinaryWithDescType binary = new Base64BinaryWithDescType();
    try {
        binary.setValue(new ASN1Integer(64).getEncoded());
        binary.setDescription("INTEGER 64");
    } catch (IOException ex) {
        throw new RuntimeException(ex.getMessage());
    }
    cap.getParameters().setBase64Binary(binary);
    return createExtensionValueType(caps);
}
Also used : SMIMECapabilities(org.xipki.ca.certprofile.x509.jaxb.SMIMECapabilities) Base64BinaryWithDescType(org.xipki.ca.certprofile.x509.jaxb.Base64BinaryWithDescType) SMIMECapability(org.xipki.ca.certprofile.x509.jaxb.SMIMECapability) ASN1Integer(org.bouncycastle.asn1.ASN1Integer) IOException(java.io.IOException) ASN1ObjectIdentifier(org.bouncycastle.asn1.ASN1ObjectIdentifier)

Aggregations

IOException (java.io.IOException)1 ASN1Integer (org.bouncycastle.asn1.ASN1Integer)1 ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)1 Base64BinaryWithDescType (org.xipki.ca.certprofile.x509.jaxb.Base64BinaryWithDescType)1 SMIMECapabilities (org.xipki.ca.certprofile.x509.jaxb.SMIMECapabilities)1 SMIMECapability (org.xipki.ca.certprofile.x509.jaxb.SMIMECapability)1