Search in sources :

Example 6 with PkiResponse

use of org.xipki.cmp.PkiResponse in project xipki by xipki.

the class X509CmpRequestor method removeCertificate.

public RevokeCertResultType removeCertificate(UnrevokeOrRemoveCertRequest request, RequestResponseDebug debug) throws CmpRequestorException, PkiErrorException {
    ParamUtil.requireNonNull("request", request);
    PKIMessage reqMessage = buildUnrevokeOrRemoveCertRequest(request, XiSecurityConstants.CMP_CRL_REASON_REMOVE);
    PkiResponse response = signAndSend(reqMessage, debug);
    return parse(response, request.getRequestEntries());
}
Also used : PKIMessage(org.bouncycastle.asn1.cmp.PKIMessage) PkiResponse(org.xipki.cmp.PkiResponse)

Example 7 with PkiResponse

use of org.xipki.cmp.PkiResponse in project xipki by xipki.

the class X509CmpRequestor method revokeCertificate.

// method evaluateCrlResponse
public RevokeCertResultType revokeCertificate(RevokeCertRequest request, RequestResponseDebug debug) throws CmpRequestorException, PkiErrorException {
    ParamUtil.requireNonNull("request", request);
    PKIMessage reqMessage = buildRevokeCertRequest(request);
    PkiResponse response = signAndSend(reqMessage, debug);
    return parse(response, request.getRequestEntries());
}
Also used : PKIMessage(org.bouncycastle.asn1.cmp.PKIMessage) PkiResponse(org.xipki.cmp.PkiResponse)

Example 8 with PkiResponse

use of org.xipki.cmp.PkiResponse in project xipki by xipki.

the class X509CmpRequestor method downloadCrl.

public X509CRL downloadCrl(BigInteger crlNumber, RequestResponseDebug debug) throws CmpRequestorException, PkiErrorException {
    Integer action = null;
    PKIMessage request;
    if (crlNumber == null) {
        ASN1ObjectIdentifier type = CMPObjectIdentifiers.it_currentCRL;
        request = buildMessageWithGeneralMsgContent(type, null);
    } else {
        action = XiSecurityConstants.CMP_ACTION_GET_CRL_WITH_SN;
        request = buildMessageWithXipkAction(action, new ASN1Integer(crlNumber));
    }
    PkiResponse response = signAndSend(request, debug);
    return evaluateCrlResponse(response, action);
}
Also used : ASN1Integer(org.bouncycastle.asn1.ASN1Integer) BigInteger(java.math.BigInteger) PKIMessage(org.bouncycastle.asn1.cmp.PKIMessage) PkiResponse(org.xipki.cmp.PkiResponse) ASN1Integer(org.bouncycastle.asn1.ASN1Integer) ASN1ObjectIdentifier(org.bouncycastle.asn1.ASN1ObjectIdentifier)

Aggregations

PKIMessage (org.bouncycastle.asn1.cmp.PKIMessage)8 PkiResponse (org.xipki.cmp.PkiResponse)8 IOException (java.io.IOException)3 ASN1OctetString (org.bouncycastle.asn1.ASN1OctetString)3 BigInteger (java.math.BigInteger)2 ASN1Integer (org.bouncycastle.asn1.ASN1Integer)2 DEROctetString (org.bouncycastle.asn1.DEROctetString)2 DERUTF8String (org.bouncycastle.asn1.DERUTF8String)2 PKIBody (org.bouncycastle.asn1.cmp.PKIBody)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InvalidKeyException (java.security.InvalidKeyException)1 CertificateException (java.security.cert.CertificateException)1 X509Certificate (java.security.cert.X509Certificate)1 HashSet (java.util.HashSet)1 ASN1Encodable (org.bouncycastle.asn1.ASN1Encodable)1 ASN1EncodableVector (org.bouncycastle.asn1.ASN1EncodableVector)1 ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)1 ASN1Sequence (org.bouncycastle.asn1.ASN1Sequence)1 DERSequence (org.bouncycastle.asn1.DERSequence)1 CMPCertificate (org.bouncycastle.asn1.cmp.CMPCertificate)1