Search in sources :

Example 1 with ObjectFactory

use of org.apache.cxf.xkms.model.xmldsig.ObjectFactory in project cxf by apache.

the class X509Utils method getKeyInfo.

public static KeyInfoType getKeyInfo(X509Certificate cert) throws CertificateEncodingException {
    KeyInfoType keyInfo = new KeyInfoType();
    JAXBElement<byte[]> certificate = new ObjectFactory().createX509DataTypeX509Certificate(cert.getEncoded());
    X509DataType x509DataType = new X509DataType();
    List<Object> x509DataContent = x509DataType.getX509IssuerSerialOrX509SKIOrX509SubjectName();
    x509DataContent.add(certificate);
    JAXBElement<X509DataType> x509Data = new ObjectFactory().createX509Data(x509DataType);
    List<Object> keyInfoContent = keyInfo.getContent();
    keyInfoContent.add(x509Data);
    return keyInfo;
}
Also used : X509DataType(org.apache.cxf.xkms.model.xmldsig.X509DataType) ObjectFactory(org.apache.cxf.xkms.model.xmldsig.ObjectFactory) KeyInfoType(org.apache.cxf.xkms.model.xmldsig.KeyInfoType)

Aggregations

KeyInfoType (org.apache.cxf.xkms.model.xmldsig.KeyInfoType)1 ObjectFactory (org.apache.cxf.xkms.model.xmldsig.ObjectFactory)1 X509DataType (org.apache.cxf.xkms.model.xmldsig.X509DataType)1