Top Inners Fields Constructors Methods
org.bouncycastle.operator.bc

public abstract Class BcContentVerifierProviderBuilder

extends Object
Class Inheritance
Known Direct Subclasses
org.bouncycastle.operator.bc.BcDSAContentVerifierProviderBuilder, org.bouncycastle.operator.bc.BcECContentVerifierProviderBuilder, org.bouncycastle.operator.bc.BcEdDSAContentVerifierProviderBuilder, org.bouncycastle.operator.bc.BcRSAContentVerifierProviderBuilder
Imports
java.io.IOException, .OutputStream, org.bouncycastle.asn1.x509.AlgorithmIdentifier, .SubjectPublicKeyInfo, org.bouncycastle.cert.X509CertificateHolder, org.bouncycastle.crypto.Signer, org.bouncycastle.crypto.params.AsymmetricKeyParameter, org.bouncycastle.operator.ContentVerifier, .ContentVerifierProvider, .OperatorCreationException

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
protected BcDigestProvider

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ContentVerifierProvider
build(final X509CertificateHolder certHolder)

public ContentVerifierProvider
build(final AsymmetricKeyParameter publicKey)

private BcSignerOutputStream
protected abstract Signer

Returns:

a Signer object.
createSigner
(AlgorithmIdentifier
the algorithm details for the signature we want to verify.
sigAlgId
)

Create the correct signer for the algorithm identifier sigAlgId.

protected abstract AsymmetricKeyParameter

Returns:

an AsymmetricKeyParameter object containing the appropriate public key.
extractKeyParameters
(SubjectPublicKeyInfo
a publicKeyInfo structure describing the public key required.
publicKeyInfo
)

Extract an AsymmetricKeyParameter from the passed in SubjectPublicKeyInfo structure.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

digestProviderback to summary
protected BcDigestProvider digestProvider

Constructor Detail

BcContentVerifierProviderBuilderback to summary
public BcContentVerifierProviderBuilder()

Method Detail

buildback to summary
public ContentVerifierProvider build(final X509CertificateHolder certHolder) throws OperatorCreationException
buildback to summary
public ContentVerifierProvider build(final AsymmetricKeyParameter publicKey) throws OperatorCreationException
createSignatureStreamback to summary
private BcSignerOutputStream createSignatureStream(AlgorithmIdentifier algorithm, AsymmetricKeyParameter publicKey) throws OperatorCreationException
createSignerback to summary
protected abstract Signer createSigner(AlgorithmIdentifier sigAlgId) throws OperatorCreationException

Create the correct signer for the algorithm identifier sigAlgId.

Parameters
sigAlgId:AlgorithmIdentifier

the algorithm details for the signature we want to verify.

Returns:Signer

a Signer object.

Exceptions
OperatorCreationException:
if the Signer cannot be constructed.
extractKeyParametersback to summary
protected abstract AsymmetricKeyParameter extractKeyParameters(SubjectPublicKeyInfo publicKeyInfo) throws IOException

Extract an AsymmetricKeyParameter from the passed in SubjectPublicKeyInfo structure.

Parameters
publicKeyInfo:SubjectPublicKeyInfo

a publicKeyInfo structure describing the public key required.

Returns:AsymmetricKeyParameter

an AsymmetricKeyParameter object containing the appropriate public key.

Exceptions
IOException:
if the publicKeyInfo data cannot be parsed,
org.bouncycastle.operator.bc back to summary

private Class BcContentVerifierProviderBuilder.SigVerifier

extends Object
implements ContentVerifier
Class Inheritance
  • java.lang.Object
  • org.bouncycastle.operator.bc.BcContentVerifierProviderBuilder.SigVerifier
All Implemented Interfaces
org.bouncycastle.operator.ContentVerifier

Field Summary

Modifier and TypeField and Description
private AlgorithmIdentifier
private BcSignerOutputStream

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public AlgorithmIdentifier
getAlgorithmIdentifier()

Implements org.bouncycastle.operator.ContentVerifier.getAlgorithmIdentifier.

Return the algorithm identifier describing the signature algorithm and parameters this verifier supports.

public OutputStream
getOutputStream()

Implements org.bouncycastle.operator.ContentVerifier.getOutputStream.

Returns a stream that will accept data for the purpose of calculating a signature for later verification.

public boolean
verify(byte[]
expected value of the signature on the data.
expected
)

Implements org.bouncycastle.operator.ContentVerifier.verify.

Return true if the expected value of the signature matches the data passed into the stream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

algorithmback to summary
private AlgorithmIdentifier algorithm
streamback to summary
private BcSignerOutputStream stream

Constructor Detail

SigVerifierback to summary
pack-priv SigVerifier(AlgorithmIdentifier algorithm, BcSignerOutputStream stream)

Method Detail

getAlgorithmIdentifierback to summary
public AlgorithmIdentifier getAlgorithmIdentifier()

Implements org.bouncycastle.operator.ContentVerifier.getAlgorithmIdentifier.

Doc from org.bouncycastle.operator.ContentVerifier.getAlgorithmIdentifier.

Return the algorithm identifier describing the signature algorithm and parameters this verifier supports.

Returns:AlgorithmIdentifier

algorithm oid and parameters.

getOutputStreamback to summary
public OutputStream getOutputStream()

Implements org.bouncycastle.operator.ContentVerifier.getOutputStream.

Doc from org.bouncycastle.operator.ContentVerifier.getOutputStream.

Returns a stream that will accept data for the purpose of calculating a signature for later verification. Use org.bouncycastle.util.io.TeeOutputStream if you want to accumulate the data on the fly as well.

Returns:OutputStream

an OutputStream

verifyback to summary
public boolean verify(byte[] expected)

Implements org.bouncycastle.operator.ContentVerifier.verify.

Doc from org.bouncycastle.operator.ContentVerifier.verify.

Return true if the expected value of the signature matches the data passed into the stream.

Parameters
expected:byte[]

expected value of the signature on the data.

Returns:boolean

true if the signature verifies, false otherwise