Package org.xipki.security
Interface ConcurrentContentSigner
-
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
DfltConcurrentContentSigner
public interface ConcurrentContentSigner extends Closeable
ConcurrentContentSigner.- Since:
- 2.0.0
- Author:
- Lijun Liao (xipki)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ConcurrentBagEntrySignerborrowSigner()Borrows a signer with implementation-dependent default timeout.ConcurrentBagEntrySignerborrowSigner(int soTimeout)Borrows a signer with the givensoTimeout.SignAlgogetAlgorithm()Returns the algorithm.X509CertgetCertificate()X509Cert[]getCertificateChain()StringgetName()PublicKeygetPublicKey()byte[]getSha1OfMacKey()KeygetSigningKey()Get the signing key.voidinitialize(String conf, org.xipki.password.PasswordResolver passwordResolver)Initializes me.booleanisHealthy()booleanisMac()voidrequiteSigner(ConcurrentBagEntrySigner signer)voidsetCertificateChain(X509Cert[] certchain)Set the CertificateChain.voidsetPublicKey(PublicKey publicKey)Sets the public key.byte[]sign(byte[] data)Sign the data.byte[][]sign(byte[][] data)Sign the data.
-
-
-
Method Detail
-
getName
String getName()
-
getAlgorithm
SignAlgo getAlgorithm()
Returns the algorithm.- Returns:
- algorithm
-
isMac
boolean isMac()
-
getSha1OfMacKey
byte[] getSha1OfMacKey()
-
getSigningKey
Key getSigningKey()
Get the signing key.- Returns:
- the signing key if possible.
nullmay be returned.
-
setPublicKey
void setPublicKey(PublicKey publicKey)
Sets the public key.- Parameters:
publicKey- Public key of this signer. Must not benull.
-
getPublicKey
PublicKey getPublicKey()
-
getCertificate
X509Cert getCertificate()
-
setCertificateChain
void setCertificateChain(X509Cert[] certchain)
Set the CertificateChain.- Parameters:
certchain- Certificate chain of this signer. Could benull.
-
getCertificateChain
X509Cert[] getCertificateChain()
-
initialize
void initialize(String conf, org.xipki.password.PasswordResolver passwordResolver) throws XiSecurityException
Initializes me.- Parameters:
conf- Configuration. Could benull.passwordResolver- Password resolver. Could benull.- Throws:
XiSecurityException- if error during the initialization occurs.
-
sign
byte[] sign(byte[] data) throws NoIdleSignerException, SignatureExceptionSign the data.- Parameters:
data- Data to be signed. Must not benull.- Returns:
- the signature
- Throws:
NoIdleSignerException- If no idle signer is availableSignatureException- If could not sign the data.
-
sign
byte[][] sign(byte[][] data) throws NoIdleSignerException, SignatureExceptionSign the data.- Parameters:
data- Data to be signed. Must not benull.- Returns:
- the signature
- Throws:
NoIdleSignerException- If no idle signer is availableSignatureException- If could not sign the data.
-
borrowSigner
ConcurrentBagEntrySigner borrowSigner() throws NoIdleSignerException
Borrows a signer with implementation-dependent default timeout.- Returns:
- the signer
- Throws:
NoIdleSignerException- If no idle signer is available
-
borrowSigner
ConcurrentBagEntrySigner borrowSigner(int soTimeout) throws NoIdleSignerException
Borrows a signer with the givensoTimeout.- Parameters:
soTimeout- timeout in milliseconds, 0 for infinitely.- Returns:
- the signer
- Throws:
NoIdleSignerException- If no idle signer is available
-
requiteSigner
void requiteSigner(ConcurrentBagEntrySigner signer)
-
isHealthy
boolean isHealthy()
-
-