public class SecurityFactoryImpl extends AbstractSecurityFactory
SecurityFactory.| Constructor and Description |
|---|
SecurityFactoryImpl() |
| Modifier and Type | Method and Description |
|---|---|
KeypairGenerator |
createKeypairGenerator(String type,
String conf)
Creates keypair generator.
|
ConcurrentContentSigner |
createSigner(String type,
SignerConf conf,
X509Cert[] certificateChain)
Creates signer.
|
PublicKey |
generatePublicKey(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo subjectPublicKeyInfo)
Create PublicKey from the
subjectPublicKeyInfo. |
org.bouncycastle.operator.ContentVerifierProvider |
getContentVerifierProvider(PublicKey publicKey,
DHSigStaticKeyCertPair ownerKeyAndCert)
Gets the ContentVerifierProvider from the public key.
|
int |
getDfltSignerParallelism() |
org.xipki.password.PasswordResolver |
getPasswordResolver() |
SecureRandom |
getRandom4Key() |
SecureRandom |
getRandom4Sign() |
Set<String> |
getSupportedKeypairGeneratorTypes()
Retrieves the types of supported keypair generators.
|
Set<String> |
getSupportedSignerTypes()
Retrieves the types of supported signers.
|
boolean |
isStrongRandom4KeyEnabled() |
boolean |
isStrongRandom4SignEnabled() |
void |
setDefaultSignerParallelism(int defaultSignerParallelism) |
void |
setKeypairGeneratorFactoryRegister(KeypairGeneratorFactoryRegister keypairGeneratorFactoryRegister) |
void |
setPasswordResolver(org.xipki.password.PasswordResolver passwordResolver) |
void |
setSignerFactoryRegister(SignerFactoryRegister signerFactoryRegister) |
void |
setStrongRandom4KeyEnabled(boolean strongRandom4KeyEnabled) |
void |
setStrongRandom4SignEnabled(boolean strongRandom4SignEnabled) |
boolean |
verifyPop(org.bouncycastle.pkcs.PKCS10CertificationRequest csr,
AlgorithmValidator algoValidator,
DHSigStaticKeyCertPair ownerKeyAndCert)
Verifies the signature of CSR.
|
createSigner, getContentVerifierProvider, getContentVerifierProvider, verifyPop, verifyPop, verifyPoppublic Set<String> getSupportedSignerTypes()
SecurityFactorynull.public boolean isStrongRandom4KeyEnabled()
public void setStrongRandom4KeyEnabled(boolean strongRandom4KeyEnabled)
public boolean isStrongRandom4SignEnabled()
public void setStrongRandom4SignEnabled(boolean strongRandom4SignEnabled)
public ConcurrentContentSigner createSigner(String type, SignerConf conf, X509Cert[] certificateChain) throws org.xipki.util.exception.ObjectCreationException
SecurityFactorytype - Type of the signer. Must not be null.conf - Configuration of the signer. Could be null.certificateChain - Certificates of the signer. If not null, it will be used; otherwise
the certificates contained in the token will be used.org.xipki.util.exception.ObjectCreationException - if could not create the signerpublic Set<String> getSupportedKeypairGeneratorTypes()
SecurityFactorynull.public KeypairGenerator createKeypairGenerator(String type, String conf) throws org.xipki.util.exception.ObjectCreationException
SecurityFactorytype - Type of the generator. Must not be null.conf - Configuration of the generator. Could be null.org.xipki.util.exception.ObjectCreationException - if could not create the keypair generatorpublic org.bouncycastle.operator.ContentVerifierProvider getContentVerifierProvider(PublicKey publicKey, DHSigStaticKeyCertPair ownerKeyAndCert) throws InvalidKeyException
SecurityFactorypublicKey - Signature verification key. Must not be null.ownerKeyAndCert - The owner's key and certificate for the CSR with Diffie-Hellman PoP.
May be null.InvalidKeyException - If the publicKey is invalid or unsupported.public PublicKey generatePublicKey(org.bouncycastle.asn1.x509.SubjectPublicKeyInfo subjectPublicKeyInfo) throws InvalidKeyException
SecurityFactorysubjectPublicKeyInfo.subjectPublicKeyInfo - From which the public key will be created. Must not be null.InvalidKeyException - if could not create public key.public boolean verifyPop(org.bouncycastle.pkcs.PKCS10CertificationRequest csr,
AlgorithmValidator algoValidator,
DHSigStaticKeyCertPair ownerKeyAndCert)
SecurityFactorycsr - CSR to be verified. Must not be null.algoValidator - Signature algorithms validator. null to accept all algorithmsownerKeyAndCert - The owner's key and certificate for the CSR with Diffie-Hellman PoP.
May be null.true if the signature is valid and the signature algorithm is accepted,
false otherwise.public int getDfltSignerParallelism()
public void setDefaultSignerParallelism(int defaultSignerParallelism)
public void setSignerFactoryRegister(SignerFactoryRegister signerFactoryRegister)
public void setKeypairGeneratorFactoryRegister(KeypairGeneratorFactoryRegister keypairGeneratorFactoryRegister)
public void setPasswordResolver(org.xipki.password.PasswordResolver passwordResolver)
public org.xipki.password.PasswordResolver getPasswordResolver()
public SecureRandom getRandom4Key()
public SecureRandom getRandom4Sign()
Copyright © 2023. All rights reserved.