Search in sources :

Example 1 with X509CertificateFormatException

use of com.intel.mtwilson.util.x509.X509CertificateFormatException in project OpenAttestation by OpenAttestation.

the class Certificate method getX509Certificate.

@JsonIgnore
@Override
public X509Certificate getX509Certificate() {
    if (certificate == null) {
        return null;
    }
    try {
        log.debug("Certificate bytes length {}", certificate.length);
        log.info("Certificate bytes length {}", certificate.length);
        return X509Util.decodeDerCertificate(certificate);
    } catch (CertificateException e) {
        //            throw new ASException(ce, ErrorCode.MS_CERTIFICATE_ENCODING_ERROR, ce.getClass().getSimpleName()); 
        throw new X509CertificateFormatException(e, certificate);
    }
}
Also used : X509CertificateFormatException(com.intel.mtwilson.util.x509.X509CertificateFormatException) CertificateException(java.security.cert.CertificateException) JsonIgnore(org.codehaus.jackson.annotate.JsonIgnore)

Aggregations

X509CertificateFormatException (com.intel.mtwilson.util.x509.X509CertificateFormatException)1 CertificateException (java.security.cert.CertificateException)1 JsonIgnore (org.codehaus.jackson.annotate.JsonIgnore)1