public class CAdESSigner extends Object implements PKCS7Signer
| Constructor and Description |
|---|
CAdESSigner() |
CAdESSigner(String algorithm,
PolicyFactory.Policies police) |
CAdESSigner(String algorithm,
PolicyFactory.Policies police,
boolean pades) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
doAttachedSign(byte[] content)
Generates a digital signature from a content and attaches this content on result file
|
byte[] |
doAttachedSign(byte[] content,
byte[] previewSigned)
Generates a digital co-signature from a content and attaches this content on result file
|
byte[] |
doCounterSign(byte[] previewCMSSignature)
Generates a digital couter-signature
|
byte[] |
doDetachedSign(byte[] content)
Generates a digital signature from a content,
the result file does not contains the content that was signed
|
byte[] |
doDetachedSign(byte[] content,
byte[] previewSigned)
Generates a digital co-signature from a content,
the result file does not contains the content that was signed
|
byte[] |
doHashCoSign(byte[] hash,
byte[] previewSigned)
Generates a digital co-signature from a previous calculated hash for a content,
and its previous signatures
the result file does not contains the original content that was signed
|
byte[] |
doHashSign(byte[] hash)
Generates a digital signature from a previous calculated hash for a content,
the result file does not contains the original content that was signed
|
String |
getAlgorithm()
Returns the algorithm to be used in the signature
|
CertificateManager |
getCertificateManager() |
Date |
getNotAfterSignerCertificate()
Data of end of Certificate use.
|
String |
getPolicyName() |
PrivateKey |
getPrivateKey()
Returns the private key.
|
PrivateKey |
getPrivateKeyForTimeStamp() |
Provider |
getProvider()
Returns the provider.
|
PublicKey |
getPublicKey()
Returns the public key.
|
String |
getSignatory() |
boolean |
isDefaultCertificateValidators() |
boolean |
isPades() |
void |
setAlgorithm(SignerAlgorithmEnum algorithm)
Set an algorithm pre-defined in enumeration.
|
void |
setAlgorithm(String algorithm)
Set a Signature Algorithm.
|
void |
setCertificateManager(CertificateManager certificateManager) |
void |
setCertificates(Certificate[] certificates)
Assign a Certificate for validate or generate a signature
|
void |
setCertificatesForTimeStamp(Certificate[] certificates)
Assign a Certificate for get timeStamp
|
void |
setDefaultCertificateValidators(boolean defaultCertificateValidators) |
void |
setNotAfterSignerCertificate(Date notAfterSignerCertificate) |
void |
setPades(boolean pades) |
void |
setPolicyName(String policyName) |
void |
setPrivateKey(PrivateKey privateKey)
Private key required for asymmetric cryptography
|
void |
setPrivateKeyForTimeStamp(PrivateKey privateKeyForTimeStamp)
the private key to use for request timestamp
|
void |
setProvider(Provider provider)
Indicates which Provider will be used.
|
void |
setPublicKey(PublicKey publicKey)
Public key needed for asymmetric cryptography
|
void |
setSignatory(String signatory) |
void |
setSignaturePolicy(PolicyFactory.Policies signaturePolicy)
Assign a Policy for validate or generate a signature
|
public CAdESSigner()
public CAdESSigner(String algorithm, PolicyFactory.Policies police)
public CAdESSigner(String algorithm, PolicyFactory.Policies police, boolean pades)
public String getAlgorithm()
SignergetAlgorithm in interface Signerpublic PrivateKey getPrivateKey()
SignergetPrivateKey in interface Signerpublic Provider getProvider()
SignergetProvider in interface Signerpublic PublicKey getPublicKey()
SignergetPublicKey in interface Signerpublic boolean isDefaultCertificateValidators()
public void setAlgorithm(SignerAlgorithmEnum algorithm)
SignersetAlgorithm in interface Signeralgorithm - algorithm representation to be usedpublic void setAlgorithm(String algorithm)
SignersetAlgorithm in interface Signeralgorithm - algorithm to be usedpublic void setCertificates(Certificate[] certificates)
PKCS7SignersetCertificates in interface PKCS7Signercertificates - certificate to be usedpublic void setDefaultCertificateValidators(boolean defaultCertificateValidators)
public void setPrivateKey(PrivateKey privateKey)
SignersetPrivateKey in interface SignerprivateKey - private key to be usedpublic void setProvider(Provider provider)
SignersetProvider in interface Signerprovider - provider to be usedpublic void setPublicKey(PublicKey publicKey)
SignersetPublicKey in interface SignerpublicKey - public key to be usedpublic void setSignaturePolicy(PolicyFactory.Policies signaturePolicy)
PKCS7SignersetSignaturePolicy in interface PKCS7SignersignaturePolicy - Signature policy to be usedpublic byte[] doAttachedSign(byte[] content)
SignerdoAttachedSign in interface Signercontent - content to be signedpublic byte[] doDetachedSign(byte[] content)
SignerdoDetachedSign in interface Signercontent - content to be signedpublic byte[] doAttachedSign(byte[] content,
byte[] previewSigned)
PKCS7SignerdoAttachedSign in interface PKCS7Signercontent - content to be signedpreviewSigned - CMS content from preview signedpublic byte[] doDetachedSign(byte[] content,
byte[] previewSigned)
PKCS7SignerdoDetachedSign in interface PKCS7Signercontent - content to be signedpreviewSigned - CMS content from preview signedpublic byte[] doCounterSign(byte[] previewCMSSignature)
PKCS7SignerdoCounterSign in interface PKCS7SignerpreviewCMSSignature - CMS content from preview signedpublic byte[] doHashSign(byte[] hash)
PKCS7SignerdoHashSign in interface PKCS7SignerdoHashSign in interface Signerhash - hash to be signedpublic byte[] doHashCoSign(byte[] hash,
byte[] previewSigned)
PKCS7SignerdoHashCoSign in interface PKCS7Signerhash - hash to be signedpreviewSigned - previous signaturepublic String getPolicyName()
public void setPolicyName(String policyName)
public CertificateManager getCertificateManager()
public void setCertificateManager(CertificateManager certificateManager)
public boolean isPades()
public void setPades(boolean pades)
public Date getNotAfterSignerCertificate()
SignergetNotAfterSignerCertificate in interface Signerpublic void setNotAfterSignerCertificate(Date notAfterSignerCertificate)
notAfterSignerCertificate - the notAfterSignerCertificate to setpublic void setCertificatesForTimeStamp(Certificate[] certificates)
PKCS7SignersetCertificatesForTimeStamp in interface PKCS7Signercertificates - certificate to be usedpublic void setPrivateKeyForTimeStamp(PrivateKey privateKeyForTimeStamp)
setPrivateKeyForTimeStamp in interface SignerprivateKeyForTimeStamp - to be used for request timestamppublic PrivateKey getPrivateKeyForTimeStamp()
getPrivateKeyForTimeStamp in interface Signerpublic String getSignatory()
getSignatory in interface Signerpublic void setSignatory(String signatory)
Copyright © 2021 SERPRO - Serviço Federal de Processamento de Dados. All rights reserved.