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));
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private AlgorithmIdentifier | |
| private boolean | |
| private JcaSimpleSignerInfoGeneratorBuilder. | |
| private CMSAttributeTableGenerator | |
| private CMSAttributeTableGenerator |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public SignerInfoGenerator | |
| public SignerInfoGenerator | |
| public SignerInfoGenerator | |
| private SignerInfoGeneratorBuilder | |
| public JcaSimpleSignerInfoGeneratorBuilder | |
| public JcaSimpleSignerInfoGeneratorBuilder | Returns: the builder objectIf 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. |
| public JcaSimpleSignerInfoGeneratorBuilder | |
| public JcaSimpleSignerInfoGeneratorBuilder | |
| public JcaSimpleSignerInfoGeneratorBuilder | |
| public JcaSimpleSignerInfoGeneratorBuilder | Returns: this.table of attributes for priming generator attrTable)set up a DefaultSignedAttributeTableGenerator primed with the passed in AttributeTable. |
| public JcaSimpleSignerInfoGeneratorBuilder |
| contentDigest | back to summary |
|---|---|
| private AlgorithmIdentifier contentDigest | |
| hasNoSignedAttributes | back to summary |
|---|---|
| private boolean hasNoSignedAttributes | |
| helper | back to summary |
|---|---|
| private JcaSimpleSignerInfoGeneratorBuilder. | |
| signedGen | back to summary |
|---|---|
| private CMSAttributeTableGenerator signedGen | |
| unsignedGen | back to summary |
|---|---|
| private CMSAttributeTableGenerator unsignedGen | |
| JcaSimpleSignerInfoGeneratorBuilder | back to summary |
|---|---|
| public JcaSimpleSignerInfoGeneratorBuilder() throws OperatorCreationException | |
| build | back to summary |
|---|---|
| public SignerInfoGenerator build(String algorithmName, PrivateKey privateKey, X509CertificateHolder certificate) throws OperatorCreationException | |
| build | back to summary |
|---|---|
| public SignerInfoGenerator build(String algorithmName, PrivateKey privateKey, X509Certificate certificate) throws OperatorCreationException, CertificateEncodingException | |
| build | back to summary |
|---|---|
| public SignerInfoGenerator build(String algorithmName, PrivateKey privateKey, byte[] keyIdentifier) throws OperatorCreationException | |
| configureAndBuild | back to summary |
|---|---|
| private SignerInfoGeneratorBuilder configureAndBuild() throws OperatorCreationException | |
| setContentDigest | back to summary |
|---|---|
| public JcaSimpleSignerInfoGeneratorBuilder setContentDigest(AlgorithmIdentifier contentDigest) | |
| setDirectSignature | back to summary |
|---|---|
| public 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.
| |
| setProvider | back to summary |
|---|---|
| public JcaSimpleSignerInfoGeneratorBuilder setProvider(String providerName) throws OperatorCreationException | |
| setProvider | back to summary |
|---|---|
| public JcaSimpleSignerInfoGeneratorBuilder setProvider(Provider provider) throws OperatorCreationException | |
| setSignedAttributeGenerator | back to summary |
|---|---|
| public JcaSimpleSignerInfoGeneratorBuilder setSignedAttributeGenerator(CMSAttributeTableGenerator signedGen) | |
| setSignedAttributeGenerator | back to summary |
|---|---|
| public JcaSimpleSignerInfoGeneratorBuilder setSignedAttributeGenerator(AttributeTable attrTable) set up a DefaultSignedAttributeTableGenerator primed with the passed in AttributeTable.
| |
| setUnsignedAttributeGenerator | back to summary |
|---|---|
| public JcaSimpleSignerInfoGeneratorBuilder setUnsignedAttributeGenerator(CMSAttributeTableGenerator unsignedGen) | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv ContentSigner | |
| pack-priv DigestCalculatorProvider |
| Helper | back to summary |
|---|---|
| private Helper() | |
| createContentSigner | back to summary |
|---|---|
| pack-priv ContentSigner createContentSigner(String algorithm, PrivateKey privateKey) throws OperatorCreationException | |
| createDigestCalculatorProvider | back to summary |
|---|---|
| pack-priv DigestCalculatorProvider createDigestCalculatorProvider() throws OperatorCreationException | |
| Modifier and Type | Field and Description |
|---|---|
| private final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv ContentSigner | createContentSigner(String algorithm, PrivateKey privateKey)
Overrides org. |
| pack-priv DigestCalculatorProvider |
| providerName | back to summary |
|---|---|
| private final String providerName | |
| NamedHelper | back to summary |
|---|---|
| public NamedHelper(String providerName) | |
| createContentSigner | back to summary |
|---|---|
| pack-priv ContentSigner createContentSigner(String algorithm, PrivateKey privateKey) throws OperatorCreationException Overrides org. | |
| createDigestCalculatorProvider | back to summary |
|---|---|
| pack-priv DigestCalculatorProvider createDigestCalculatorProvider() throws OperatorCreationException | |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv ContentSigner | createContentSigner(String algorithm, PrivateKey privateKey)
Overrides org. |
| pack-priv DigestCalculatorProvider |
| provider | back to summary |
|---|---|
| private final Provider provider | |
| ProviderHelper | back to summary |
|---|---|
| public ProviderHelper(Provider provider) | |
| createContentSigner | back to summary |
|---|---|
| pack-priv ContentSigner createContentSigner(String algorithm, PrivateKey privateKey) throws OperatorCreationException Overrides org. | |
| createDigestCalculatorProvider | back to summary |
|---|---|
| pack-priv DigestCalculatorProvider createDigestCalculatorProvider() throws OperatorCreationException | |