public class PKCS1SignerImpl extends Object implements PKCS1Signer
| Constructor and Description |
|---|
PKCS1SignerImpl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
check(byte[] content,
byte[] signed)
Performs checking for signed content using the Java API.
|
boolean |
checkAttached(byte[] signedData) |
List<SignatureInformations> |
checkAttachedSignature(byte[] signedData) |
List<SignatureInformations> |
checkSignatureByHash(String digestAlgorithm,
byte[] calculatedHashContent,
byte[] signedData) |
byte[] |
doAttachedSign(byte[] content)
Generates a digital signature from a content and attaches this content on result file
|
byte[] |
doDetachedSign(byte[] content)
Generates a digital signature from a content,
the result file does not contains the 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
|
Date |
getNotAfterSignerCertificate()
Data of end of Certificate use.
|
PrivateKey |
getPrivateKey()
Returns the private key.
|
PrivateKey |
getPrivateKeyForTimeStamp() |
Provider |
getProvider()
Returns the provider.
|
PublicKey |
getPublicKey()
Returns the public key.
|
String |
getSignatory() |
void |
setAlgorithm(SignerAlgorithmEnum algorithm)
Set an algorithm pre-defined in enumeration.
|
void |
setAlgorithm(String algorithm)
Set a Signature Algorithm.
|
void |
setPrivateKey(PrivateKey privateKey)
Private key required for asymmetric cryptography
|
void |
setPrivateKeyForTimeStamp(PrivateKey privateKeyToTimeStamp)
Private key required for sign timestamp request
|
void |
setProvider(Provider provider)
Indicates which Provider will be used.
|
void |
setPublicKey(PublicKey publicKey)
Public key needed for asymmetric cryptography
|
public boolean check(byte[] content,
byte[] signed)
SignerAlgorithmEnum.DEFAULT enumeration algorithm
will be used. For this method it is necessary to inform the
original content, signed content and the public key.content - Original content to be compared to signed content.signed - Signed content to be verified.true if and only if content was correctly
verified.public void setProvider(Provider provider)
SignersetProvider in interface Signerprovider - provider to be usedpublic void setAlgorithm(String algorithm)
SignersetAlgorithm in interface Signeralgorithm - algorithm to be usedpublic void setAlgorithm(SignerAlgorithmEnum algorithm)
SignersetAlgorithm in interface Signeralgorithm - algorithm representation to be usedpublic void setPrivateKey(PrivateKey privateKey)
SignersetPrivateKey in interface SignerprivateKey - private key to be usedpublic void setPublicKey(PublicKey publicKey)
SignersetPublicKey in interface SignerpublicKey - public key to be usedpublic Provider getProvider()
SignergetProvider in interface Signerpublic PrivateKey getPrivateKey()
SignergetPrivateKey in interface Signerpublic String getAlgorithm()
SignergetAlgorithm in interface Signerpublic PublicKey getPublicKey()
SignergetPublicKey in interface Signerpublic 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[] doHashSign(byte[] hash)
SignerdoHashSign in interface Signerhash - hash to be signedpublic boolean checkAttached(byte[] signedData)
public List<SignatureInformations> checkSignatureByHash(String digestAlgorithm, byte[] calculatedHashContent, byte[] signedData)
public List<SignatureInformations> checkAttachedSignature(byte[] signedData)
public void setPrivateKeyForTimeStamp(PrivateKey privateKeyToTimeStamp)
SignersetPrivateKeyForTimeStamp in interface SignerprivateKeyToTimeStamp - to be used for request timestamppublic PrivateKey getPrivateKeyForTimeStamp()
getPrivateKeyForTimeStamp in interface Signerpublic Date getNotAfterSignerCertificate()
SignergetNotAfterSignerCertificate in interface Signerpublic String getSignatory()
getSignatory in interface SignerCopyright © 2021 SERPRO - Serviço Federal de Processamento de Dados. All rights reserved.