public class PKCS7
extends java.lang.Object
| Constructor and Description |
|---|
PKCS7(AlgorithmId[] digestAlgorithmIds,
ContentInfo contentInfo,
java.security.cert.X509Certificate[] certificates,
SignerInfo[] signerInfos)
Construct an initialized PKCS7 block.
|
PKCS7(byte[] bytes)
Unmarshals a PKCS7 block from its encoded form, parsing the
encoded bytes.
|
PKCS7(DerInputStream derin)
Unmarshals a PKCS7 block from its encoded form, parsing the
encoded bytes from the DerInputStream.
|
PKCS7(java.io.InputStream in)
Unmarshals a PKCS7 block from its encoded form, parsing the
encoded bytes from the InputStream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
encodeSignedData(DerOutputStream out)
Encodes the signed data to a DerOutputStream.
|
void |
encodeSignedData(java.io.OutputStream out)
Encodes the signed data to an output stream.
|
java.security.cert.X509Certificate |
getCertificate(java.math.BigInteger serial,
X500Name issuerName)
Returns the X.509 certificate listed in this PKCS7 block
which has a matching serial number and Issuer name, or
null if one is not found.
|
java.security.cert.X509Certificate[] |
getCertificates()
Returns the X.509 certificates listed in this PKCS7 block.
|
ContentInfo |
getContentInfo()
Returns the content information specified in this PKCS7 block.
|
java.security.cert.X509CRL[] |
getCRLs()
Returns the X.509 crls listed in this PKCS7 block.
|
AlgorithmId[] |
getDigestAlgorithmIds()
Returns the message digest algorithms specified in this PKCS7 block.
|
SignerInfo[] |
getSignerInfos()
Returns the signer's information specified in this PKCS7 block.
|
java.math.BigInteger |
getVersion()
Returns the version number of this PKCS7 block.
|
boolean |
isOldStyle()
Returns true if this is a JDK1.1.x-style PKCS#7 block, and false
otherwise.
|
java.lang.String |
toString()
Returns the PKCS7 block in a printable string form.
|
SignerInfo[] |
verify()
Returns all signerInfos which self-verify.
|
SignerInfo[] |
verify(byte[] bytes)
Returns all signerInfos which self-verify.
|
SignerInfo |
verify(SignerInfo info,
byte[] bytes)
This verifies a given SignerInfo.
|
public PKCS7(java.io.InputStream in)
throws ParsingException,
java.io.IOException
in - an input stream holding at least one PKCS7 block.ParsingException - on parsing errors.java.io.IOException - on other errors.public PKCS7(DerInputStream derin) throws ParsingException
derin - a DerInputStream holding at least one PKCS7 block.ParsingException - on parsing errors.public PKCS7(byte[] bytes)
throws ParsingException
bytes - the encoded bytes.ParsingException - on parsing errors.public PKCS7(AlgorithmId[] digestAlgorithmIds, ContentInfo contentInfo, java.security.cert.X509Certificate[] certificates, SignerInfo[] signerInfos)
digestAlgorithmIds - the message digest algorithm identifiers.contentInfo - the content information.certificates - an array of X.509 certificates.signerInfos - an array of signer information.public void encodeSignedData(java.io.OutputStream out)
throws java.io.IOException
out - the output stream to write the encoded data to.java.io.IOException - on encoding errors.public void encodeSignedData(DerOutputStream out) throws java.io.IOException
out - the DerOutputStream to write the encoded data to.java.io.IOException - on encoding errors.public SignerInfo verify(SignerInfo info, byte[] bytes) throws java.security.NoSuchAlgorithmException, java.security.SignatureException
info - the signer information.bytes - the DER encoded content information.java.security.NoSuchAlgorithmException - on unrecognized algorithms.java.security.SignatureException - on signature handling errors.public SignerInfo[] verify(byte[] bytes) throws java.security.NoSuchAlgorithmException, java.security.SignatureException
bytes - the DER encoded content information.java.security.NoSuchAlgorithmException - on unrecognized algorithms.java.security.SignatureException - on signature handling errors.public SignerInfo[] verify() throws java.security.NoSuchAlgorithmException, java.security.SignatureException
java.security.NoSuchAlgorithmException - on unrecognized algorithms.java.security.SignatureException - on signature handling errors.public java.math.BigInteger getVersion()
public AlgorithmId[] getDigestAlgorithmIds()
public ContentInfo getContentInfo()
public java.security.cert.X509Certificate[] getCertificates()
public java.security.cert.X509CRL[] getCRLs()
public SignerInfo[] getSignerInfos()
public java.security.cert.X509Certificate getCertificate(java.math.BigInteger serial,
X500Name issuerName)
serial - the serial number of the certificate to retrieve.issuerName - the Distinguished Name of the Issuer.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isOldStyle()
Copyright © 2020. All Rights Reserved.