Class OCSPUtils
java.lang.Object
br.ufsc.labsec.signature.conformanceVerifier.OCSPUtils
public class OCSPUtils extends Object
-
Field Summary
Fields Modifier and Type Field Description static String
UNABLE_TO_GET_OCSP_ENCODED
-
Constructor Summary
Constructors Constructor Description OCSPUtils()
-
Method Summary
Modifier and Type Method Description static Optional<org.bouncycastle.cert.ocsp.OCSPReq>
buildOCSPRequest(Object certificate, Object issuer)
Cria uma requisição para servidor OCSPstatic byte[]
digest(String algorithm, org.bouncycastle.asn1.ocsp.BasicOCSPResponse ocsp)
static byte[]
digest(org.bouncycastle.asn1.ASN1ObjectIdentifier identifier, org.bouncycastle.asn1.ocsp.BasicOCSPResponse ocsp)
static byte[]
digest(org.bouncycastle.asn1.ocsp.BasicOCSPResponse ocsp)
static byte[]
digest(org.bouncycastle.asn1.ocsp.OCSPRequest ocsp)
static byte[]
digest(org.bouncycastle.asn1.ocsp.OCSPResponse ocsp)
static byte[]
digest(org.bouncycastle.cert.ocsp.OCSPReq ocsp)
static byte[]
DIGEST(String algorithm, org.bouncycastle.asn1.ocsp.BasicOCSPResponse ocsp)
static byte[]
DIGEST(org.bouncycastle.asn1.ASN1ObjectIdentifier identifier, org.bouncycastle.asn1.ocsp.BasicOCSPResponse ocsp)
static byte[]
DIGEST(org.bouncycastle.asn1.ocsp.BasicOCSPResponse ocsp)
static Collection<org.bouncycastle.asn1.ocsp.BasicOCSPResponse>
filterBasicOCSPResponses(Collection<org.bouncycastle.cert.ocsp.OCSPResp> ocsps)
static String
getOCSPURL(Object certificate)
Busca a URL do servidor OCSP presente na AIA do certificado dadostatic boolean
ISDIGEST(byte[] expectedDigest, org.bouncycastle.asn1.ocsp.BasicOCSPResponse ocsp)
static boolean
ISDIGEST(String algorithm, byte[] expectedDigest, org.bouncycastle.asn1.ocsp.BasicOCSPResponse ocsp)
static boolean
ISDIGEST(org.bouncycastle.asn1.ASN1ObjectIdentifier identifier, byte[] expectedDigest, org.bouncycastle.asn1.ocsp.BasicOCSPResponse ocsp)
static org.bouncycastle.cert.ocsp.OCSPResp
requestOCSPResponse(String url, org.bouncycastle.cert.ocsp.OCSPReq ocspReq)
Faz a requisição para o servidor OCSP presente na URL dada
-
Field Details
-
UNABLE_TO_GET_OCSP_ENCODED
- See Also:
- Constant Field Values
-
-
Constructor Details
-
OCSPUtils
public OCSPUtils()
-
-
Method Details
-
buildOCSPRequest
public static Optional<org.bouncycastle.cert.ocsp.OCSPReq> buildOCSPRequest(Object certificate, Object issuer)Cria uma requisição para servidor OCSP- Parameters:
certificate
- Certificado a ser validadoissuer
- Certificado do emissor- Returns:
- A requisição para servidor OCSP gerada
-
requestOCSPResponse
public static org.bouncycastle.cert.ocsp.OCSPResp requestOCSPResponse(String url, org.bouncycastle.cert.ocsp.OCSPReq ocspReq) throws IOExceptionFaz a requisição para o servidor OCSP presente na URL dada- Parameters:
url
- A URL do servidor OCSPocspReq
- A requisição a ser enviada- Returns:
- A resposta do servidor OCSP
- Throws:
IOException
- Exceção em caso de má formação da requisição
-
getOCSPURL
Busca a URL do servidor OCSP presente na AIA do certificado dado- Parameters:
certificate
- Certificado a ser analisado- Returns:
- A URL do servidor OCSP identificada na AIA do certificado
- Throws:
AIAException
- Exceção em caso de má formação da AIA do certificado
-
filterBasicOCSPResponses
public static Collection<org.bouncycastle.asn1.ocsp.BasicOCSPResponse> filterBasicOCSPResponses(Collection<org.bouncycastle.cert.ocsp.OCSPResp> ocsps) -
digest
public static byte[] digest(org.bouncycastle.asn1.ocsp.BasicOCSPResponse ocsp) throws NoSuchAlgorithmException, IOException- Throws:
NoSuchAlgorithmException
IOException
-
digest
public static byte[] digest(org.bouncycastle.asn1.ocsp.OCSPResponse ocsp) throws NoSuchAlgorithmException, IOException- Throws:
NoSuchAlgorithmException
IOException
-
digest
public static byte[] digest(org.bouncycastle.cert.ocsp.OCSPReq ocsp) throws NoSuchAlgorithmException, IOException- Throws:
NoSuchAlgorithmException
IOException
-
digest
public static byte[] digest(org.bouncycastle.asn1.ocsp.OCSPRequest ocsp) throws NoSuchAlgorithmException, IOException- Throws:
NoSuchAlgorithmException
IOException
-
digest
public static byte[] digest(org.bouncycastle.asn1.ASN1ObjectIdentifier identifier, org.bouncycastle.asn1.ocsp.BasicOCSPResponse ocsp) throws NoSuchAlgorithmException, IOException- Throws:
NoSuchAlgorithmException
IOException
-
digest
public static byte[] digest(String algorithm, org.bouncycastle.asn1.ocsp.BasicOCSPResponse ocsp) throws NoSuchAlgorithmException, IOException- Throws:
NoSuchAlgorithmException
IOException
-
DIGEST
public static byte[] DIGEST(org.bouncycastle.asn1.ocsp.BasicOCSPResponse ocsp) -
DIGEST
public static byte[] DIGEST(org.bouncycastle.asn1.ASN1ObjectIdentifier identifier, org.bouncycastle.asn1.ocsp.BasicOCSPResponse ocsp) -
DIGEST
-
ISDIGEST
public static boolean ISDIGEST(byte[] expectedDigest, org.bouncycastle.asn1.ocsp.BasicOCSPResponse ocsp) -
ISDIGEST
public static boolean ISDIGEST(org.bouncycastle.asn1.ASN1ObjectIdentifier identifier, byte[] expectedDigest, org.bouncycastle.asn1.ocsp.BasicOCSPResponse ocsp) -
ISDIGEST
public static boolean ISDIGEST(String algorithm, byte[] expectedDigest, org.bouncycastle.asn1.ocsp.BasicOCSPResponse ocsp)
-