public class JcaSimpleSignerInfoGeneratorBuilder extends Object
For example:
CMSSignedDataGenerator gen = new CMSSignedDataGenerator(); ContentSigner sha1Signer = new JcaContentSignerBuilder("SHA1withRSA").setProvider("BC").build(signKP.getPrivate()); gen.addSignerInfoGenerator( new JcaSignerInfoGeneratorBuilder( new JcaDigestCalculatorProviderBuilder().setProvider("BC").build()) .build(sha1Signer, signCert));becomes:
CMSSignedDataGenerator gen = new CMSSignedDataGenerator(); gen.addSignerInfoGenerator( new JcaSimpleSignerInfoGeneratorBuilder() .setProvider("BC") .build("SHA1withRSA", signKP.getPrivate(), signCert));
Constructor and Description |
---|
JcaSimpleSignerInfoGeneratorBuilder() |
Modifier and Type | Method and Description |
---|---|
SignerInfoGenerator |
build(String algorithmName,
PrivateKey privateKey,
byte[] keyIdentifier) |
SignerInfoGenerator |
build(String algorithmName,
PrivateKey privateKey,
X509Certificate certificate) |
JcaSimpleSignerInfoGeneratorBuilder |
setDirectSignature(boolean hasNoSignedAttributes)
If the passed in flag is true, the signer signature will be based on the data, not
a collection of signed attributes, and no signed attributes will be included.
|
JcaSimpleSignerInfoGeneratorBuilder |
setProvider(Provider provider) |
JcaSimpleSignerInfoGeneratorBuilder |
setProvider(String providerName) |
JcaSimpleSignerInfoGeneratorBuilder |
setSignedAttributeGenerator(org.bouncycastle.asn1.cms.AttributeTable attrTable)
set up a DefaultSignedAttributeTableGenerator primed with the passed in AttributeTable.
|
JcaSimpleSignerInfoGeneratorBuilder |
setSignedAttributeGenerator(CMSAttributeTableGenerator signedGen) |
JcaSimpleSignerInfoGeneratorBuilder |
setUnsignedAttributeGenerator(CMSAttributeTableGenerator unsignedGen) |
public JcaSimpleSignerInfoGeneratorBuilder() throws OperatorCreationException
OperatorCreationException
public JcaSimpleSignerInfoGeneratorBuilder setProvider(String providerName) throws OperatorCreationException
OperatorCreationException
public JcaSimpleSignerInfoGeneratorBuilder setProvider(Provider provider) throws OperatorCreationException
OperatorCreationException
public JcaSimpleSignerInfoGeneratorBuilder setDirectSignature(boolean hasNoSignedAttributes)
public JcaSimpleSignerInfoGeneratorBuilder setSignedAttributeGenerator(CMSAttributeTableGenerator signedGen)
public JcaSimpleSignerInfoGeneratorBuilder setSignedAttributeGenerator(org.bouncycastle.asn1.cms.AttributeTable attrTable)
attrTable
- table of attributes for priming generatorpublic JcaSimpleSignerInfoGeneratorBuilder setUnsignedAttributeGenerator(CMSAttributeTableGenerator unsignedGen)
public SignerInfoGenerator build(String algorithmName, PrivateKey privateKey, X509Certificate certificate) throws OperatorCreationException, CertificateEncodingException
public SignerInfoGenerator build(String algorithmName, PrivateKey privateKey, byte[] keyIdentifier) throws OperatorCreationException, CertificateEncodingException
Copyright © 2016 BouncyCastle.org. All rights reserved.