Package com.itextpdf.bouncycastlefips
Class BouncyCastleFipsFactory
java.lang.Object
com.itextpdf.bouncycastlefips.BouncyCastleFipsFactory
- All Implemented Interfaces:
-
IBouncyCastleFactory
This class implements
IBouncyCastleFactory
and creates bouncy-castle FIPS classes instances.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreate OCSP Exception wrapper from usualException
.createAlgorithmIdentifier
(IASN1ObjectIdentifier algorithm) Create algorithm identifier wrapper from ASN1 Object identifier wrapper.createAlgorithmIdentifier
(IASN1ObjectIdentifier algorithm, IASN1Encodable parameters) Create algorithm identifier wrapper from ASN1 Object identifier wrapper and ASN1 Encodable wrapper for the parameters.createASN1BitString
(IASN1Encodable encodable) Cast ASN1 Encodable wrapper to ASN1 Bit string wrapper.Create ASN1 Dump wrapper without parameters.Create ASN1 Encodable wrapper without parameters.Create ASN1 Encoding without parameters.createASN1Enumerated
(int i) Create ASN1 Enumerated wrapper fromint
value.createASN1Enumerated
(IASN1Encodable object) Create ASN1 Enumerated wrapper fromIASN1Encodable
value.createASN1GeneralizedTime
(IASN1Encodable encodable) Cast ASN1 Encodable wrapper to ASN1 Generalized time wrapper.createASN1InputStream
(byte[] bytes) Create ASN1 Input stream wrapper frombyte[]
.createASN1InputStream
(InputStream stream) Create ASN1 Input stream wrapper fromInputStream
.createASN1Integer
(int i) Create ASN1 Integer wrapper fromint
.createASN1Integer
(IASN1Encodable encodable) Cast ASN1 Encodable wrapper to ASN1 Integer wrapper.Create ASN1 Integer wrapper fromBigInteger
.createASN1ObjectIdentifier
(IASN1Encodable encodable) Cast ASN1 encodable wrapper to the ASN1 object identifier wrapper.Create ASN1 Object identifier wrapper fromString
.Create ASN1 Object identifier wrapper fromObject
usinggetInstance
method call.createASN1OctetString
(byte[] bytes) Create ASN1 Octet string wrapper frombyte[]
.createASN1OctetString
(IASN1Encodable encodable) Cast ASN1 Encodable wrapper to the ASN1 Octet string wrapper.createASN1OctetString
(IASN1TaggedObject taggedObject, boolean b) Create ASN1 Octet string wrapper from ASN1 Tagged object wrapper andboolean
parameter.createASN1OutputStream
(OutputStream stream) Create ASN1 Output stream wrapper fromOutputStream
.createASN1OutputStream
(OutputStream outputStream, String asn1Encoding) Create ASN1 Output stream wrapper fromOutputStream
and ASN1 Encoding.createASN1Primitive
(byte[] array) Create ASN1 Primitive wrapper frombyte[]
value.createASN1Primitive
(IASN1Encodable encodable) Cast ASN1 Encodable wrapper to ASN1 Primitive wrapper.createASN1Sequence
(byte[] array) Create ASN1 Sequence wrapper frombyte[]
.createASN1Sequence
(IASN1Encodable encodable) Cast ASN1 encodable wrapper to the ASN1 Sequence wrapper.createASN1Sequence
(Object object) CastObject
to ASN1 Sequence wrapper.createASN1SequenceInstance
(Object object) Create ASN1 Sequence wrapper fromObject
usinggetInstance
method call.createASN1Set
(IASN1Encodable encodable) Cast ASN1 Encodable wrapper to ASN1 Set wrapper.createASN1Set
(IASN1TaggedObject taggedObject, boolean b) Create ASN1 Set wrapper from ASN1 Tagged object wrapper andboolean
parameter.createASN1Set
(Object encodable) Create ASN1 Set wrapper fromObject
.createASN1String
(IASN1Encodable encodable) Cast ASN1 Encodable wrapper to ASN1 String wrapper.createASN1TaggedObject
(IASN1Encodable encodable) Create ASN1 Tagged object wrapper from ASN1 Encodable wrapper.createASN1UTCTime
(IASN1Encodable encodable) Cast ASN1 Encodable wrapper to ASN1 UTC Time wrapper.createAttribute
(IASN1ObjectIdentifier attrType, IASN1Set attrValues) Create attribute wrapper from ASN1 Object identifier wrapper and ASN1 Set wrapper.createAttributeTable
(IASN1Set unat) Create attribute table wrapper from ASN1 Set wrapper.createBasicConstraints
(boolean b) Create basic constraints wrapper fromboolean
value.createBasicOCSPResp
(IBasicOCSPResponse response) Create basic OCSP Resp wrapper from basic OCSP Response wrapper.createBasicOCSPResp
(Object response) Create basic OCSP Resp wrapper fromObject
.createBasicOCSPRespBuilder
(IRespID respID) Create basic OCSP Resp builder wrapper from resp ID wrapper.createBasicOCSPResponse
(byte[] bytes) Create basic OCSP Response wrapper frombyte[]
array.createBasicOCSPResponse
(IASN1Primitive primitive) Create basic OCSP Response wrapper from ASN1 Primitive wrapper.Create certificate ID wrapper without parameters.createCertificateID
(IDigestCalculator digestCalculator, IX509CertificateHolder certificateHolder, BigInteger bigInteger) Create certificate ID wrapper from digest calculator, X509 Certificate holder wrappers andBigInteger
.Create certificate status wrapper without parameters.byte[]
createCipherBytes
(X509Certificate x509certificate, byte[] abyte0, IAlgorithmIdentifier algorithmIdentifier) Create cipher bytes fromX509Certificate
,byte[]
value and algorithm identifier wrapper.createCMSEnvelopedData
(byte[] bytes) Create CMS enveloped data frombyte[]
value.createContentInfo
(IASN1ObjectIdentifier objectIdentifier, IASN1Encodable encodable) Create content info wrapper from ASN1 Object identifier wrapper and ASN1 Encodable wrapper.createContentInfo
(IASN1Sequence sequence) Create content info wrapper from ASN1 Sequence wrapper.createCRLDistPoint
(Object object) Create CRL Dist point wrapper fromObject
.Create CRL Reason wrapper without parameters.createDERIA5String
(IASN1TaggedObject taggedObject, boolean b) Create DERIA5 String wrapper from ASN1 Tagged object wrapper andboolean
value.createDERIA5String
(String str) Create DERIA5 String wrapper fromString
value.Create DER Null wrapper without parameters.createDEROctetString
(byte[] bytes) Create DER Octet string wrapper frombyte[]
.createDEROctetString
(IASN1Encodable encodable) Cast ASN1 Encodable wrapper to DER Octet string wrapper.createDERSequence
(IASN1EncodableVector encodableVector) Create DER Sequence wrapper from ASN1 Encodable vector wrapper.createDERSequence
(IASN1Primitive primitive) Create DER Sequence wrapper from ASN1 Primitive wrapper.createDERSet
(IRecipientInfo recipientInfo) Create DER Set wrapper from recipient info wrapper.createDERSet
(ISignaturePolicyIdentifier identifier) Create DER Set wrapper from signature policy identifier wrapper.createDERSet
(IASN1EncodableVector encodableVector) Create DER Set wrapper from ASN1 Encodable vector wrapper.createDERSet
(IASN1Primitive primitive) Create DER Set wrapper from ASN1 Primitive wrapper.createDERTaggedObject
(boolean b, int i, IASN1Primitive primitive) Create DER Tagged object wrapper fromint
value,boolean
value and ASN1 Primitive wrapper.createDERTaggedObject
(int i, IASN1Primitive primitive) Create DER Tagged object wrapper fromint
value and ASN1 Primitive wrapper.Create distribution point name wrapper without parameters.createEncryptedContentInfo
(IASN1ObjectIdentifier data, IAlgorithmIdentifier algorithmIdentifier, IASN1OctetString octetString) Create encrypted content info wrapper from ASN1 Object identifier wrapper, algorithm identifier wrapper and ASN1 Octet string wrapper.createEnvelopedData
(IOriginatorInfo originatorInfo, IASN1Set set, IEncryptedContentInfo encryptedContentInfo, IASN1Set set1) Create enveloped data wrapper from originator info wrapper, ASN1 Set wrapper, encrypted content info wrapper and another ASN1 Set wrapper.createExtendedKeyUsage
(IKeyPurposeId purposeId) Create extended key usage wrapper from key purpose id wrapper.Create extension wrapper without parameters.createExtension
(IASN1ObjectIdentifier objectIdentifier, boolean critical, IASN1OctetString octetString) Create extension wrapper from ASN1 Object identifier wrapper,boolean
and ASN1 Octet string wrapper.createExtensions
(IExtension extension) Create extensions wrapper from extension wrapper.Create general name wrapper without parameters.createGeneralNames
(IASN1Encodable encodable) Cast ASN1 Encodable wrapper to general names wrapper.createIssuerAndSerialNumber
(IX500Name issuer, BigInteger value) Create issuer and serial number wrapper from X500 Name wrapper andBigInteger
.createJcaCertStore
(List<Certificate> certificates) Create Jca cert store wrapper fromList
ofCertificate
objects.createJcaContentSignerBuilder
(String algorithm) Create Jca content signer builder wrapper fromString
algorithm.Create Jca Content verifier provider builder wrapper without parameters.Create Jca Digest calculator provider builder wrapper without parameters.Create Jca PEM Key converter wrapper without parameters.createJcaSignerInfoGeneratorBuilder
(IDigestCalculatorProvider digestCalcProviderProvider) Create Jca signer info generator builder wrapper from digest calculator provider wrapper.Create Jca Simple signer info verifier builder wrapper without parameters.Create Jca X509 Certificate converter wrapper without parameters.createJcaX509CertificateHolder
(X509Certificate certificate) Create Jca X509 Certificate holder wrapper fromX509Certificate
.createJcaX509v3CertificateBuilder
(X509Certificate signingCert, BigInteger certSerialNumber, Date startDate, Date endDate, IX500Name subjectDnName, PublicKey publicKey) Create Jca X509 Version 3 certificate builder wrapper fromX509Certificate
,BigInteger
, startDate
, endDate
, X500 Name wrapper andPublicKey
.createJceKeyAgreeEnvelopedRecipient
(PrivateKey privateKey) Create Jce Key agree enveloped recipient wrapper fromPrivateKey
.createJceKeyTransEnvelopedRecipient
(PrivateKey privateKey) Create Jce Key trans enveloped recipient wrapper fromPrivateKey
.Create Jce open SSL PKCS8 Decryptor provider builder wrapper without parameters.Create key purpose id wrapper without parameters.createKeyTransRecipientInfo
(IRecipientIdentifier recipientIdentifier, IAlgorithmIdentifier algorithmIdentifier, IASN1OctetString octetString) Create key trans recipient info wrapper from recipient identifier wrapper, algorithm identifier wrapper and ASN1 Octet string wrapper.Create key usage wrapper without parameters.createKeyUsage
(int i) Create key usage wrapper fromint
value.Create ASN1 Set wrapper which will storenull
.Createnull
asCRL
object.Create extensions wrapper fornull
value.Create originator info wrapper withnull
value.Create OCSP Object identifiers wrapper without parameters.createOCSPReq
(byte[] requestBytes) Create OCSP Req wrapper frombyte[]
.Create OCSP Req builder wrapper without parameters.Create OCSP Resp wrapper without parameters.createOCSPResp
(byte[] bytes) Create OCSP Resp wrapper frombyte[]
value.createOCSPResp
(IOCSPResponse ocspResponse) Create OCSP Resp wrapper from OCSP Response wrapper.Create OCSP Resp builder wrapper without parameters.Create OCSP Resp builder wrapper usinggetInstance
call.createOCSPResponse
(IOCSPResponseStatus respStatus, IResponseBytes responseBytes) Create OCSP Response wrapper from OCSP Response status wrapper and response bytes wrapper.Create OCSP Response status wrapper without parameters.createOCSPResponseStatus
(int status) Create OCSP Response status wrapper fromint
value.createOtherHashAlgAndValue
(IAlgorithmIdentifier algorithmIdentifier, IASN1OctetString octetString) Create other hash alg and value wrapper from algorithm identifier wrapper and ASN1 Octet string wrapper.createPEMParser
(Reader reader) Create PEM Parser wrapper fromReader
.Create PKCS Object identifiers wrapper without parameters.createRecipientIdentifier
(IIssuerAndSerialNumber issuerAndSerialNumber) Create recipient identifier wrapper from issuer and serial number wrapper.createRecipientInfo
(IKeyTransRecipientInfo keyTransRecipientInfo) Create recipient info wrapper from key trans recipient info wrapper.createRespID
(IX500Name x500Name) Create resp ID wrapper from X500 Name wrapper.createResponseBytes
(IASN1ObjectIdentifier asn1ObjectIdentifier, IDEROctetString derOctetString) Create response bytes wrapper from ASN1 Object identifier wrapper and DER Octet string wrapper.createRevokedStatus
(ICertificateStatus certificateStatus) Create revoked status wrapper from certificate status wrapper.createRevokedStatus
(Date date, int i) Create revoked status wrapper fromDate
andint
value.createRSASSAPSSParams
(IASN1Encodable encodable) Create a RSASSA-PSS params wrapper from an ASN1 Encodable wrapper.createRSASSAPSSParamsWithMGF1
(IASN1ObjectIdentifier digestAlgoOid, int saltLen, int trailerField) Create a RSASSA-PSS params wrapper from a digest algorithm OID, a salt length and a trailer field length.createSignaturePolicyId
(IASN1ObjectIdentifier objectIdentifier, IOtherHashAlgAndValue algAndValue) Create signature policy id wrapper from ASN1 Object identifier wrapper and other hash alg and value wrapper.createSignaturePolicyId
(IASN1ObjectIdentifier objectIdentifier, IOtherHashAlgAndValue algAndValue, ISigPolicyQualifierInfo... policyQualifiers) Create signature policy id wrapper from ASN1 Object identifier wrapper, other hash alg and value wrapper and sig policy qualifier info wrappers.Create signature policy identifier wrapper from signature policy id wrapper.createSigningCertificate
(IASN1Sequence sequence) Create signing certificate wrapper from ASN1 Sequence wrapper.createSigningCertificateV2
(IASN1Sequence sequence) Create signing certificate version 2 wrapper from ASN1 Sequence wrapper.createSigPolicyQualifierInfo
(IASN1ObjectIdentifier objectIdentifier, IDERIA5String string) Create sig policy qualifier info wrapper from ASN1 Object identifier wrapper and DERIA5 String wrapper.createSingleResp
(IBasicOCSPResponse basicResp) Create single resp wrapper from basic OCSP Response wrapper.createSubjectPublicKeyInfo
(Object object) Create subject public key info wrapper fromObject
.createTBSCertificate
(byte[] bytes) Create TBS Certificate wrapper from ASN1 Encoded data.createTBSCertificate
(IASN1Encodable encodable) Create TBS Certificate wrapper from ASN1 Encodable wrapper.createTime
(Date date) Create time wrapper fromDate
.createTimeStampRequest
(byte[] bytes) Create timestamp request wrapper frombyte[]
value.Create timestamp request generator wrapper without parameters.createTimeStampResponse
(byte[] respBytes) Create timestamp response wrapper frombyte[]
value.createTimeStampResponseGenerator
(ITimeStampTokenGenerator tokenGenerator, Set<String> algorithms) Create timestamp response generator wrapper from timestamp token generator wrapper andSet
of algorithms.createTimeStampToken
(IContentInfo contentInfo) Create timestamp token wrapper from content info wrapper.createTimeStampTokenGenerator
(ISignerInfoGenerator siGen, IDigestCalculator dgCalc, IASN1ObjectIdentifier policy) Create timestamp token generator wrapper from signer info generator wrapper, digest calculator wrapper and ASN1 Object identifier wrapper.createTSTInfo
(IContentInfo contentInfo) Create TST Info wrapper from content info wrapper.Create unknown status wrapper without parameters.Create X500 Name wrapper fromString
.createX500Name
(X509Certificate certificate) Create X500 Name wrapper fromX509Certificate
.createX509Certificate
(Object element) CastObject
element toX509Certificate
.createX509CertificateHolder
(byte[] bytes) Create X509 Certificate holder wrapper frombyte[]
.createX509ExtensionUtils
(IDigestCalculator digestCalculator) Create X509 Extension utils wrapper from digest calculator wrapper.createX509v2CRLBuilder
(IX500Name x500Name, Date date) Create X509 Version 2 CRL Builder wrapper from X500 Name wrapper andDate
.getAlgorithmName
(String oid) Get signing algorithm name from its oid.getAlgorithmOid
(String name) Get signing algorithm oid from its name.GetIBouncyCastleTestConstantsFactory
corresponding to thisIBouncyCastleFactory
.getDigestAlgorithmOid
(String name) Get hash algorithm oid from its name.GetProvider
instance for this factory.GetString
which represents providers name for this factory.GetSecureRandom
implementation from the factory.void
isEncryptionFeatureSupported
(int encryptionType, boolean withCertificate) Checks whether an algorithm is supported for encryption by the chosen Bouncy Castle implementation, throws an exception when not supported.boolean
Check if this bouncy-castle corresponding to this factory is in approved mode.boolean
isNull
(IASN1Encodable encodable) Check if provided encodable wrapper wrapnull
.boolean
Checks if provided extension wrapper wrapsnull
.
-
Constructor Details
-
BouncyCastleFipsFactory
public BouncyCastleFipsFactory()CreatesIBouncyCastleFactory
for bouncy-castle FIPS module.
-
-
Method Details
-
getAlgorithmOid
Get signing algorithm oid from its name.- Specified by:
-
getAlgorithmOid
in interfaceIBouncyCastleFactory
- Parameters:
-
name
- name of the algorithm - Returns:
- algorithm oid
-
getDigestAlgorithmOid
Get hash algorithm oid from its name.- Specified by:
-
getDigestAlgorithmOid
in interfaceIBouncyCastleFactory
- Parameters:
-
name
- name of the algorithm - Returns:
- algorithm oid
-
getAlgorithmName
Get signing algorithm name from its oid.- Specified by:
-
getAlgorithmName
in interfaceIBouncyCastleFactory
- Parameters:
-
oid
- oid of the algorithm - Returns:
- algorithm name
-
createASN1ObjectIdentifier
Cast ASN1 encodable wrapper to the ASN1 object identifier wrapper.- Specified by:
-
createASN1ObjectIdentifier
in interfaceIBouncyCastleFactory
- Parameters:
-
encodable
- wrapper to be cast - Returns:
- casted wrapper
-
createASN1ObjectIdentifier
Create ASN1 Object identifier wrapper fromString
.- Specified by:
-
createASN1ObjectIdentifier
in interfaceIBouncyCastleFactory
- Parameters:
-
str
-String
to create object identifier from - Returns:
- created object identifier
-
createASN1ObjectIdentifierInstance
Create ASN1 Object identifier wrapper fromObject
usinggetInstance
method call.- Specified by:
-
createASN1ObjectIdentifierInstance
in interfaceIBouncyCastleFactory
- Parameters:
-
object
-Object
to create object identifier from - Returns:
- created object identifier
-
createASN1InputStream
Create ASN1 Input stream wrapper fromInputStream
.- Specified by:
-
createASN1InputStream
in interfaceIBouncyCastleFactory
- Parameters:
-
stream
-InputStream
to create ASN1 Input stream from - Returns:
- created ASN1 Input stream
-
createASN1InputStream
Create ASN1 Input stream wrapper frombyte[]
.- Specified by:
-
createASN1InputStream
in interfaceIBouncyCastleFactory
- Parameters:
-
bytes
-byte[]
to create ASN1 Input stream from - Returns:
- created ASN1 Input stream
-
createASN1OctetString
Cast ASN1 Encodable wrapper to the ASN1 Octet string wrapper.- Specified by:
-
createASN1OctetString
in interfaceIBouncyCastleFactory
- Parameters:
-
encodable
- to be casted to ASN1 Octet string wrapper - Returns:
- casted ASN1 Octet string wrapper
-
createASN1OctetString
Create ASN1 Octet string wrapper from ASN1 Tagged object wrapper andboolean
parameter.- Specified by:
-
createASN1OctetString
in interfaceIBouncyCastleFactory
- Parameters:
-
taggedObject
- ASN1 Tagged object wrapper to create ASN1 Octet string wrapper from -
b
- boolean to create ASN1 Octet string wrapper - Returns:
- created ASN1 Octet string wrapper
-
createASN1OctetString
Create ASN1 Octet string wrapper frombyte[]
.- Specified by:
-
createASN1OctetString
in interfaceIBouncyCastleFactory
- Parameters:
-
bytes
-byte[]
to create ASN1 Octet string wrapper from - Returns:
- created ASN1 Octet string wrapper
-
createASN1Sequence
CastObject
to ASN1 Sequence wrapper.- Specified by:
-
createASN1Sequence
in interfaceIBouncyCastleFactory
- Parameters:
-
object
-Object
to be cast. Must be instance of ASN1 Sequence - Returns:
- casted ASN1 Sequence wrapper
-
createASN1Sequence
Cast ASN1 encodable wrapper to the ASN1 Sequence wrapper.- Specified by:
-
createASN1Sequence
in interfaceIBouncyCastleFactory
- Parameters:
-
encodable
- to be casted to ASN1 Sequence wrapper - Returns:
- casted ASN1 Sequence wrapper
-
createASN1Sequence
Create ASN1 Sequence wrapper frombyte[]
.- Specified by:
-
createASN1Sequence
in interfaceIBouncyCastleFactory
- Parameters:
-
array
-byte[]
to create ASN1 Sequence wrapper from - Returns:
- created ASN1 Sequence wrapper
- Throws:
-
IOException
- if issues occur during ASN1 Sequence creation
-
createASN1SequenceInstance
Create ASN1 Sequence wrapper fromObject
usinggetInstance
method call.- Specified by:
-
createASN1SequenceInstance
in interfaceIBouncyCastleFactory
- Parameters:
-
object
-Object
to create ASN1 Sequence wrapper from - Returns:
- created ASN1 Sequence wrapper
-
createDERSequence
Create DER Sequence wrapper from ASN1 Encodable vector wrapper.- Specified by:
-
createDERSequence
in interfaceIBouncyCastleFactory
- Parameters:
-
encodableVector
- ASN1 Encodable vector wrapper to create DER Sequence wrapper from - Returns:
- created DER Sequence wrapper
-
createDERSequence
Create DER Sequence wrapper from ASN1 Primitive wrapper.- Specified by:
-
createDERSequence
in interfaceIBouncyCastleFactory
- Parameters:
-
primitive
- ASN1 Primitive wrapper to create DER Sequence wrapper from - Returns:
- created DER Sequence wrapper
-
createASN1TaggedObject
Create ASN1 Tagged object wrapper from ASN1 Encodable wrapper.- Specified by:
-
createASN1TaggedObject
in interfaceIBouncyCastleFactory
- Parameters:
-
encodable
- ASN1 Encodable vector to create ASN1 Tagged object wrapper from - Returns:
- created ASN1 Tagged object wrapper
-
createASN1Integer
Cast ASN1 Encodable wrapper to ASN1 Integer wrapper.- Specified by:
-
createASN1Integer
in interfaceIBouncyCastleFactory
- Parameters:
-
encodable
- ASN1 Encodable wrapper to be cast - Returns:
- casted ASN1 Integer
-
createASN1Integer
Create ASN1 Integer wrapper fromint
.- Specified by:
-
createASN1Integer
in interfaceIBouncyCastleFactory
- Parameters:
-
i
-int
to create ASN1 Integer wrapper from - Returns:
- created ASN1 Integer wrapper
-
createASN1Integer
Create ASN1 Integer wrapper fromBigInteger
.- Specified by:
-
createASN1Integer
in interfaceIBouncyCastleFactory
- Parameters:
-
i
-BigInteger
to create ASN1 Integer wrapper from - Returns:
- created ASN1 Integer wrapper
-
createASN1Set
Cast ASN1 Encodable wrapper to ASN1 Set wrapper.- Specified by:
-
createASN1Set
in interfaceIBouncyCastleFactory
- Parameters:
-
encodable
- ASN1 Encodable wrapper to be cast - Returns:
- casted ASN1 Set
-
createASN1Set
Create ASN1 Set wrapper fromObject
.- Specified by:
-
createASN1Set
in interfaceIBouncyCastleFactory
- Parameters:
-
encodable
-Object
to create ASN1 Set wrapper from. Must be instance of ASN1 Set - Returns:
- created ASN1 Set wrapper
-
createASN1Set
Create ASN1 Set wrapper from ASN1 Tagged object wrapper andboolean
parameter.- Specified by:
-
createASN1Set
in interfaceIBouncyCastleFactory
- Parameters:
-
taggedObject
- ASN1 Tagged object wrapper to create ASN1 Set wrapper from -
b
- boolean to create ASN1 Set wrapper - Returns:
- created ASN1 Set wrapper
-
createNullASN1Set
Create ASN1 Set wrapper which will storenull
.- Specified by:
-
createNullASN1Set
in interfaceIBouncyCastleFactory
- Returns:
-
ASN1 Set wrapper with
null
value
-
createASN1OutputStream
Create ASN1 Output stream wrapper fromOutputStream
.- Specified by:
-
createASN1OutputStream
in interfaceIBouncyCastleFactory
- Parameters:
-
stream
-OutputStream
to create ASN1 Output stream wrapper from - Returns:
- created ASN1 Output stream wrapper
-
createASN1OutputStream
Create ASN1 Output stream wrapper fromOutputStream
and ASN1 Encoding.- Specified by:
-
createASN1OutputStream
in interfaceIBouncyCastleFactory
- Parameters:
-
outputStream
-OutputStream
to create ASN1 Output stream wrapper from -
asn1Encoding
- ASN1 Encoding to be used - Returns:
- created ASN1 Output stream wrapper
-
createDEROctetString
Create DER Octet string wrapper frombyte[]
.- Specified by:
-
createDEROctetString
in interfaceIBouncyCastleFactory
- Parameters:
-
bytes
-byte[]
to create DER Octet string wrapper from - Returns:
- created DER Octet string wrapper
-
createDEROctetString
Cast ASN1 Encodable wrapper to DER Octet string wrapper.- Specified by:
-
createDEROctetString
in interfaceIBouncyCastleFactory
- Parameters:
-
encodable
- ASN1 Encodable wrapper to be casted - Returns:
- DER Octet string wrapper
-
createASN1EncodableVector
Create ASN1 Encodable wrapper without parameters.- Specified by:
-
createASN1EncodableVector
in interfaceIBouncyCastleFactory
- Returns:
- created ASN1 Encodable wrapper
-
createDERNull
Create DER Null wrapper without parameters.- Specified by:
-
createDERNull
in interfaceIBouncyCastleFactory
- Returns:
- created DER Null wrapper
-
createDERTaggedObject
Create DER Tagged object wrapper fromint
value and ASN1 Primitive wrapper.- Specified by:
-
createDERTaggedObject
in interfaceIBouncyCastleFactory
- Parameters:
-
i
-int
value for DER Tagged object wrapper creation -
primitive
- ASN1 Primitive wrapper to create DER Tagged object wrapper from - Returns:
- created DER Tagged object wrapper
-
createDERTaggedObject
Create DER Tagged object wrapper fromint
value,boolean
value and ASN1 Primitive wrapper.- Specified by:
-
createDERTaggedObject
in interfaceIBouncyCastleFactory
- Parameters:
-
b
-boolean
value for DER Tagged object wrapper creation -
i
-int
value for DER Tagged object wrapper creation -
primitive
- ASN1 Primitive wrapper to create DER Tagged object wrapper from - Returns:
- created DER Tagged object wrapper
-
createDERSet
Create DER Set wrapper from ASN1 Encodable vector wrapper.- Specified by:
-
createDERSet
in interfaceIBouncyCastleFactory
- Parameters:
-
encodableVector
- ASN1 Encodable vector wrapper to create DER Set wrapper from - Returns:
- created DER Set wrapper
-
createDERSet
Create DER Set wrapper from ASN1 Primitive wrapper.- Specified by:
-
createDERSet
in interfaceIBouncyCastleFactory
- Parameters:
-
primitive
- ASN1 Primitive wrapper to create DER Set wrapper from - Returns:
- created DER Set wrapper
-
createDERSet
Create DER Set wrapper from signature policy identifier wrapper.- Specified by:
-
createDERSet
in interfaceIBouncyCastleFactory
- Parameters:
-
identifier
- signature policy identifier wrapper to create DER Set wrapper from - Returns:
- created DER Set wrapper
-
createDERSet
Create DER Set wrapper from recipient info wrapper.- Specified by:
-
createDERSet
in interfaceIBouncyCastleFactory
- Parameters:
-
recipientInfo
- recipient info wrapper to create DER Set wrapper from - Returns:
- created DER Set wrapper
-
createASN1Enumerated
Create ASN1 Enumerated wrapper fromint
value.- Specified by:
-
createASN1Enumerated
in interfaceIBouncyCastleFactory
- Parameters:
-
i
-int
to create ASN1 Enumerated wrapper from - Returns:
- created ASN1 Enumerated wrapper
-
createASN1Enumerated
Create ASN1 Enumerated wrapper fromIASN1Encodable
value.- Specified by:
-
createASN1Enumerated
in interfaceIBouncyCastleFactory
- Parameters:
-
object
-IASN1Encodable
to create ASN1 Enumerated wrapper from - Returns:
- created ASN1 Enumerated wrapper.
-
createASN1Encoding
Create ASN1 Encoding without parameters.- Specified by:
-
createASN1Encoding
in interfaceIBouncyCastleFactory
- Returns:
- created ASN1 Encoding
-
createAttributeTable
Create attribute table wrapper from ASN1 Set wrapper.- Specified by:
-
createAttributeTable
in interfaceIBouncyCastleFactory
- Parameters:
-
unat
- ASN1 Set wrapper to create attribute table wrapper from - Returns:
- created attribute table wrapper
-
createPKCSObjectIdentifiers
Create PKCS Object identifiers wrapper without parameters.- Specified by:
-
createPKCSObjectIdentifiers
in interfaceIBouncyCastleFactory
- Returns:
- created PKCS Object identifiers
-
createAttribute
Create attribute wrapper from ASN1 Object identifier wrapper and ASN1 Set wrapper.- Specified by:
-
createAttribute
in interfaceIBouncyCastleFactory
- Parameters:
-
attrType
- ASN1 Object identifier wrapper to create attribute wrapper from -
attrValues
- ASN1 Object identifier wrapper to create attribute wrapper from - Returns:
- created attribute wrapper
-
createContentInfo
Create content info wrapper from ASN1 Sequence wrapper.- Specified by:
-
createContentInfo
in interfaceIBouncyCastleFactory
- Parameters:
-
sequence
- ASN1 Sequence wrapper to create content info wrapper from - Returns:
- created content info wrapper
-
createContentInfo
public IContentInfo createContentInfo(IASN1ObjectIdentifier objectIdentifier, IASN1Encodable encodable) Create content info wrapper from ASN1 Object identifier wrapper and ASN1 Encodable wrapper.- Specified by:
-
createContentInfo
in interfaceIBouncyCastleFactory
- Parameters:
-
objectIdentifier
- ASN1 Object identifier wrapper to create content info wrapper from -
encodable
- ASN1 Encodable wrapper to create content info wrapper from - Returns:
- created content info wrapper
-
createTimeStampToken
public ITimeStampToken createTimeStampToken(IContentInfo contentInfo) throws TSPExceptionBCFips, IOException Create timestamp token wrapper from content info wrapper.- Specified by:
-
createTimeStampToken
in interfaceIBouncyCastleFactory
- Parameters:
-
contentInfo
- content info wrapper to create timestamp token wrapper from - Returns:
- created timestamp token wrapper
- Throws:
-
IOException
- if input-output exception occurs during wrapper creation -
TSPExceptionBCFips
-
createSigningCertificate
Create signing certificate wrapper from ASN1 Sequence wrapper.- Specified by:
-
createSigningCertificate
in interfaceIBouncyCastleFactory
- Parameters:
-
sequence
- ASN1 Sequence wrapper to create signing certificate wrapper from - Returns:
- created signing certificate wrapper
-
createSigningCertificateV2
Create signing certificate version 2 wrapper from ASN1 Sequence wrapper.- Specified by:
-
createSigningCertificateV2
in interfaceIBouncyCastleFactory
- Parameters:
-
sequence
- ASN1 Sequence wrapper to create signing certificate version 2 wrapper from - Returns:
- created signing certificate version 2 wrapper
-
createBasicOCSPResponse
Create basic OCSP Response wrapper from ASN1 Primitive wrapper.- Specified by:
-
createBasicOCSPResponse
in interfaceIBouncyCastleFactory
- Parameters:
-
primitive
- ASN1 Primitive wrapper to create basic OCSP response wrapper from - Returns:
- created basic OCSP response wrapper
-
createBasicOCSPResponse
Create basic OCSP Response wrapper frombyte[]
array.- Specified by:
-
createBasicOCSPResponse
in interfaceIBouncyCastleFactory
- Parameters:
-
bytes
-byte[]
array to create basic OCSP response wrapper from - Returns:
- created basic OCSP response wrapper
-
createBasicOCSPResp
Create basic OCSP Resp wrapper from basic OCSP Response wrapper.- Specified by:
-
createBasicOCSPResp
in interfaceIBouncyCastleFactory
- Parameters:
-
response
- basic OCSP Response wrapper to create basic OCSP Resp wrapper from - Returns:
- created basic OCSP Resp wrapper
-
createBasicOCSPResp
Create basic OCSP Resp wrapper fromObject
.- Specified by:
-
createBasicOCSPResp
in interfaceIBouncyCastleFactory
- Parameters:
-
response
-Object
to create basic OCSP Resp wrapper from. Must be actual basic OCSP Resp instance - Returns:
- created basic OCSP Resp wrapper
-
createOCSPObjectIdentifiers
Create OCSP Object identifiers wrapper without parameters.- Specified by:
-
createOCSPObjectIdentifiers
in interfaceIBouncyCastleFactory
- Returns:
- created OCSP Object identifiers wrapper
-
createAlgorithmIdentifier
Create algorithm identifier wrapper from ASN1 Object identifier wrapper.- Specified by:
-
createAlgorithmIdentifier
in interfaceIBouncyCastleFactory
- Parameters:
-
algorithm
- ASN1 Object identifier wrapper to create algorithm identifier wrapper from - Returns:
- created algorithm identifier wrapper
-
createAlgorithmIdentifier
public IAlgorithmIdentifier createAlgorithmIdentifier(IASN1ObjectIdentifier algorithm, IASN1Encodable parameters) Create algorithm identifier wrapper from ASN1 Object identifier wrapper and ASN1 Encodable wrapper for the parameters.- Specified by:
-
createAlgorithmIdentifier
in interfaceIBouncyCastleFactory
- Parameters:
-
algorithm
- ASN1 Object identifier wrapper to create algorithm identifier wrapper from -
parameters
- ASN1 Encodable wrapper to create algorithm parameters. - Returns:
- created algorithm identifier wrapper
-
createRSASSAPSSParams
Create a RSASSA-PSS params wrapper from an ASN1 Encodable wrapper.- Specified by:
-
createRSASSAPSSParams
in interfaceIBouncyCastleFactory
- Parameters:
-
encodable
- ASN1 Encodable wrapper to create RSASSA-PSS params wrapper from - Returns:
- created RSASSA-PSS params wrapper
-
createRSASSAPSSParamsWithMGF1
public IRSASSAPSSParams createRSASSAPSSParamsWithMGF1(IASN1ObjectIdentifier digestAlgoOid, int saltLen, int trailerField) Create a RSASSA-PSS params wrapper from a digest algorithm OID, a salt length and a trailer field length. The mask generation function will be set to MGF1, and the same digest algorithm will be used to populate the MGF parameters.- Specified by:
-
createRSASSAPSSParamsWithMGF1
in interfaceIBouncyCastleFactory
- Parameters:
-
digestAlgoOid
- identifier of the digest algorithm to be used both in the MGF and in the signature -
saltLen
- salt length value -
trailerField
- trailer field value - Returns:
-
an
IRSASSAPSSParams
object initialised with the parameters supplied
-
getProvider
GetProvider
instance for this factory.- Specified by:
-
getProvider
in interfaceIBouncyCastleFactory
- Returns:
-
Provider
instance
-
getProviderName
GetString
which represents providers name for this factory.- Specified by:
-
getProviderName
in interfaceIBouncyCastleFactory
- Returns:
-
String
which represents providers name
-
createJceKeyTransEnvelopedRecipient
Create Jce Key trans enveloped recipient wrapper fromPrivateKey
.- Specified by:
-
createJceKeyTransEnvelopedRecipient
in interfaceIBouncyCastleFactory
- Parameters:
-
privateKey
-PrivateKey
to create Jce Key trans enveloped recipient wrapper from - Returns:
- created Jce Key trans enveloped recipient wrapper
-
createJceKeyAgreeEnvelopedRecipient
Create Jce Key agree enveloped recipient wrapper fromPrivateKey
.- Specified by:
-
createJceKeyAgreeEnvelopedRecipient
in interfaceIBouncyCastleFactory
- Parameters:
-
privateKey
-PrivateKey
to create Jce Key agree enveloped recipient wrapper from - Returns:
- created Jce Key agree enveloped recipient wrapper
-
createJcaContentVerifierProviderBuilder
Create Jca Content verifier provider builder wrapper without parameters.- Specified by:
-
createJcaContentVerifierProviderBuilder
in interfaceIBouncyCastleFactory
- Returns:
- created Jca Content verifier provider builder wrapper
-
createJcaSimpleSignerInfoVerifierBuilder
Create Jca Simple signer info verifier builder wrapper without parameters.- Specified by:
-
createJcaSimpleSignerInfoVerifierBuilder
in interfaceIBouncyCastleFactory
- Returns:
- created Jca Simple signer info verifier builder wrapper
-
createJcaX509CertificateConverter
Create Jca X509 Certificate converter wrapper without parameters.- Specified by:
-
createJcaX509CertificateConverter
in interfaceIBouncyCastleFactory
- Returns:
- created Jca X509 Certificate converter wrapper
-
createJcaDigestCalculatorProviderBuilder
Create Jca Digest calculator provider builder wrapper without parameters.- Specified by:
-
createJcaDigestCalculatorProviderBuilder
in interfaceIBouncyCastleFactory
- Returns:
- created Jca Digest calculator provider builder wrapper
-
createCertificateID
public ICertificateID createCertificateID(IDigestCalculator digestCalculator, IX509CertificateHolder certificateHolder, BigInteger bigInteger) throws OCSPExceptionBCFips Create certificate ID wrapper from digest calculator, X509 Certificate holder wrappers andBigInteger
.- Specified by:
-
createCertificateID
in interfaceIBouncyCastleFactory
- Parameters:
-
digestCalculator
- digest calculator wrapper to create certificate ID wrapper from -
certificateHolder
- X509 Certificate holder wrapper to create certificate ID wrapper from -
bigInteger
-BigInteger
to create certificate ID wrapper from - Returns:
- created certificate ID wrapper
- Throws:
-
OCSPExceptionBCFips
-
createCertificateID
Create certificate ID wrapper without parameters.- Specified by:
-
createCertificateID
in interfaceIBouncyCastleFactory
- Returns:
- created certificate ID wrapper
-
createX509CertificateHolder
Create X509 Certificate holder wrapper frombyte[]
.- Specified by:
-
createX509CertificateHolder
in interfaceIBouncyCastleFactory
- Parameters:
-
bytes
-byte[]
value to create X509 Certificate holder wrapper from - Returns:
- created X509 Certificate holder wrapper
- Throws:
-
IOException
- if input-output exception occurs during wrapper creation
-
createJcaX509CertificateHolder
public IJcaX509CertificateHolder createJcaX509CertificateHolder(X509Certificate certificate) throws CertificateEncodingException Create Jca X509 Certificate holder wrapper fromX509Certificate
.- Specified by:
-
createJcaX509CertificateHolder
in interfaceIBouncyCastleFactory
- Parameters:
-
certificate
-X509Certificate
to create Jca X509 Certificate holder wrapper from - Returns:
- created Jca X509 Certificate holder wrapper
- Throws:
-
CertificateEncodingException
- if certificate encoding exception occurs during wrapper creation
-
createExtension
public IExtension createExtension(IASN1ObjectIdentifier objectIdentifier, boolean critical, IASN1OctetString octetString) Create extension wrapper from ASN1 Object identifier wrapper,boolean
and ASN1 Octet string wrapper.- Specified by:
-
createExtension
in interfaceIBouncyCastleFactory
- Parameters:
-
objectIdentifier
- ASN1 Object identifier wrapper to create extension wrapper from -
critical
-boolean
to create extension wrapper -
octetString
- ASN1 Octet string wrapper to create extension wrapper from - Returns:
- created extension wrapper
-
createExtension
Create extension wrapper without parameters.- Specified by:
-
createExtension
in interfaceIBouncyCastleFactory
- Returns:
- created extension wrapper
-
createExtensions
Create extensions wrapper from extension wrapper.- Specified by:
-
createExtensions
in interfaceIBouncyCastleFactory
- Parameters:
-
extension
- extension wrapper to create extensions wrapper from - Returns:
- created extensions wrapper
-
createNullExtensions
Create extensions wrapper fornull
value.- Specified by:
-
createNullExtensions
in interfaceIBouncyCastleFactory
- Returns:
- created extensions wrapper
-
createOCSPReqBuilder
Create OCSP Req builder wrapper without parameters.- Specified by:
-
createOCSPReqBuilder
in interfaceIBouncyCastleFactory
- Returns:
- created OCSP Req builder wrapper
-
createSigPolicyQualifierInfo
public ISigPolicyQualifierInfo createSigPolicyQualifierInfo(IASN1ObjectIdentifier objectIdentifier, IDERIA5String string) Create sig policy qualifier info wrapper from ASN1 Object identifier wrapper and DERIA5 String wrapper.- Specified by:
-
createSigPolicyQualifierInfo
in interfaceIBouncyCastleFactory
- Parameters:
-
objectIdentifier
- ASN1 Object identifier wrapper to create sig policy qualifier info wrapper from -
string
- DERIA5 String wrapper to create sig policy qualifier info wrapper from - Returns:
- created sig policy qualifier info wrapper
-
createASN1String
Cast ASN1 Encodable wrapper to ASN1 String wrapper.- Specified by:
-
createASN1String
in interfaceIBouncyCastleFactory
- Parameters:
-
encodable
- ASN1 Encodable wrapper to be cast - Returns:
- casted ASN1 String wrapper
-
createASN1Primitive
Cast ASN1 Encodable wrapper to ASN1 Primitive wrapper.- Specified by:
-
createASN1Primitive
in interfaceIBouncyCastleFactory
- Parameters:
-
encodable
- ASN1 Encodable wrapper to be cast - Returns:
- casted ASN1 Primitive wrapper
-
createASN1Primitive
Create ASN1 Primitive wrapper frombyte[]
value.- Specified by:
-
createASN1Primitive
in interfaceIBouncyCastleFactory
- Parameters:
-
array
-byte[]
value to create ASN1 Primitive wrapper from - Returns:
- created ASN1 Primitive wrapper
- Throws:
-
IOException
- if input-output exception occurs during creation
-
createOCSPResp
Create OCSP Resp wrapper from OCSP Response wrapper.- Specified by:
-
createOCSPResp
in interfaceIBouncyCastleFactory
- Parameters:
-
ocspResponse
- OCSP Response wrapper to create OCSP Resp wrapper from - Returns:
- created OCSP Resp wrapper
-
createOCSPResp
Create OCSP Resp wrapper frombyte[]
value.- Specified by:
-
createOCSPResp
in interfaceIBouncyCastleFactory
- Parameters:
-
bytes
-byte[]
value to create OCSP Resp wrapper from - Returns:
- created OCSP Resp wrapper
- Throws:
-
IOException
- if input-output exception occurs during creation
-
createOCSPResp
Create OCSP Resp wrapper without parameters.- Specified by:
-
createOCSPResp
in interfaceIBouncyCastleFactory
- Returns:
- created OCSP Resp wrapper
-
createOCSPResponse
public IOCSPResponse createOCSPResponse(IOCSPResponseStatus respStatus, IResponseBytes responseBytes) Create OCSP Response wrapper from OCSP Response status wrapper and response bytes wrapper.- Specified by:
-
createOCSPResponse
in interfaceIBouncyCastleFactory
- Parameters:
-
respStatus
- OCSP Response status wrapper to create OCSP Response wrapper from -
responseBytes
- response bytes wrapper to create OCSP Response wrapper from - Returns:
- created OCSP Response wrapper
-
createResponseBytes
public IResponseBytes createResponseBytes(IASN1ObjectIdentifier asn1ObjectIdentifier, IDEROctetString derOctetString) Create response bytes wrapper from ASN1 Object identifier wrapper and DER Octet string wrapper.- Specified by:
-
createResponseBytes
in interfaceIBouncyCastleFactory
- Parameters:
-
asn1ObjectIdentifier
- ASN1 Object identifier wrapper to create response bytes wrapper from -
derOctetString
- DER Octet string wrapper to create response bytes wrapper from - Returns:
- created response bytes wrapper
-
createOCSPRespBuilderInstance
Create OCSP Resp builder wrapper usinggetInstance
call.- Specified by:
-
createOCSPRespBuilderInstance
in interfaceIBouncyCastleFactory
- Returns:
- created OCSP Resp builder wrapper
-
createOCSPRespBuilder
Create OCSP Resp builder wrapper without parameters.- Specified by:
-
createOCSPRespBuilder
in interfaceIBouncyCastleFactory
- Returns:
- created OCSP Resp builder wrapper
-
createOCSPResponseStatus
Create OCSP Response status wrapper fromint
value.- Specified by:
-
createOCSPResponseStatus
in interfaceIBouncyCastleFactory
- Parameters:
-
status
-int
value to create OCSP Response status wrapper from - Returns:
- created OCSP Response status wrapper
-
createOCSPResponseStatus
Create OCSP Response status wrapper without parameters.- Specified by:
-
createOCSPResponseStatus
in interfaceIBouncyCastleFactory
- Returns:
- created OCSP Response status wrapper
-
createCertificateStatus
Create certificate status wrapper without parameters.- Specified by:
-
createCertificateStatus
in interfaceIBouncyCastleFactory
- Returns:
- created certificate status wrapper
-
createRevokedStatus
Create revoked status wrapper from certificate status wrapper.- Specified by:
-
createRevokedStatus
in interfaceIBouncyCastleFactory
- Parameters:
-
certificateStatus
- certificate status wrapper to create revoked status wrapper from - Returns:
- created revoked status wrapper
-
createRevokedStatus
Create revoked status wrapper fromDate
andint
value.- Specified by:
-
createRevokedStatus
in interfaceIBouncyCastleFactory
- Parameters:
-
date
-Date
to create revoked status wrapper from -
i
-int
value to create revoked status wrapper from - Returns:
- created revoked status wrapper
-
createDERIA5String
Create DERIA5 String wrapper from ASN1 Tagged object wrapper andboolean
value.- Specified by:
-
createDERIA5String
in interfaceIBouncyCastleFactory
- Parameters:
-
taggedObject
- ASN1 Tagged object wrapper to create DERIA5 String wrapper from -
b
-boolean
value to create DERIA5 String wrapper from - Returns:
- created DERIA5 String wrapper
-
createDERIA5String
Create DERIA5 String wrapper fromString
value.- Specified by:
-
createDERIA5String
in interfaceIBouncyCastleFactory
- Parameters:
-
str
-String
value to create DERIA5 String wrapper from - Returns:
- created DERIA5 String wrapper
-
createCRLDistPoint
Create CRL Dist point wrapper fromObject
.- Specified by:
-
createCRLDistPoint
in interfaceIBouncyCastleFactory
- Parameters:
-
object
-Object
to create CRL Dist point wrapper from - Returns:
- created CRL Dist point wrapper
-
createDistributionPointName
Create distribution point name wrapper without parameters.- Specified by:
-
createDistributionPointName
in interfaceIBouncyCastleFactory
- Returns:
- created distribution point name wrapper
-
createGeneralNames
Cast ASN1 Encodable wrapper to general names wrapper.- Specified by:
-
createGeneralNames
in interfaceIBouncyCastleFactory
- Parameters:
-
encodable
- ASN1 Encodable wrapper to be cast - Returns:
- casted general names wrapper
-
createGeneralName
Create general name wrapper without parameters.- Specified by:
-
createGeneralName
in interfaceIBouncyCastleFactory
- Returns:
- created general name wrapper
-
createOtherHashAlgAndValue
public IOtherHashAlgAndValue createOtherHashAlgAndValue(IAlgorithmIdentifier algorithmIdentifier, IASN1OctetString octetString) Create other hash alg and value wrapper from algorithm identifier wrapper and ASN1 Octet string wrapper.- Specified by:
-
createOtherHashAlgAndValue
in interfaceIBouncyCastleFactory
- Parameters:
-
algorithmIdentifier
- algorithm identifier wrapper to create other hash alg and value wrapper from -
octetString
- ASN1 Octet string wrapper to create other hash alg and value wrapper from - Returns:
- created other hash alg and value wrapper
-
createSignaturePolicyId
public ISignaturePolicyId createSignaturePolicyId(IASN1ObjectIdentifier objectIdentifier, IOtherHashAlgAndValue algAndValue) Create signature policy id wrapper from ASN1 Object identifier wrapper and other hash alg and value wrapper.- Specified by:
-
createSignaturePolicyId
in interfaceIBouncyCastleFactory
- Parameters:
-
objectIdentifier
- ASN1 Object identifier wrapper to create signature policy id wrapper from -
algAndValue
- other hash alg and value wrapper to create signature policy id wrapper from - Returns:
- created signature policy id wrapper
-
createSignaturePolicyId
public ISignaturePolicyId createSignaturePolicyId(IASN1ObjectIdentifier objectIdentifier, IOtherHashAlgAndValue algAndValue, ISigPolicyQualifierInfo... policyQualifiers) Create signature policy id wrapper from ASN1 Object identifier wrapper, other hash alg and value wrapper and sig policy qualifier info wrappers.- Specified by:
-
createSignaturePolicyId
in interfaceIBouncyCastleFactory
- Parameters:
-
objectIdentifier
- ASN1 Object identifier wrapper to create signature policy id wrapper from -
algAndValue
- other hash alg and value wrapper to create signature policy id wrapper from -
policyQualifiers
- sig policy qualifier info wrappers to create signature policy id wrapper from - Returns:
- created signature policy id wrapper
-
createSignaturePolicyIdentifier
Create signature policy identifier wrapper from signature policy id wrapper.- Specified by:
-
createSignaturePolicyIdentifier
in interfaceIBouncyCastleFactory
- Parameters:
-
policyId
- signature policy id wrapper to create signature policy identifier wrapper from - Returns:
- created signature policy identifier wrapper
-
createEnvelopedData
public IEnvelopedData createEnvelopedData(IOriginatorInfo originatorInfo, IASN1Set set, IEncryptedContentInfo encryptedContentInfo, IASN1Set set1) Create enveloped data wrapper from originator info wrapper, ASN1 Set wrapper, encrypted content info wrapper and another ASN1 Set wrapper.- Specified by:
-
createEnvelopedData
in interfaceIBouncyCastleFactory
- Parameters:
-
originatorInfo
- originator info wrapper to create enveloped data wrapper from -
set
- ASN1 Set wrapper to create enveloped data wrapper from -
encryptedContentInfo
- encrypted content info wrapper to create enveloped data wrapper from -
set1
- ASN1 Set wrapper to create enveloped data wrapper from - Returns:
- created enveloped data wrapper
-
createRecipientInfo
Create recipient info wrapper from key trans recipient info wrapper.- Specified by:
-
createRecipientInfo
in interfaceIBouncyCastleFactory
- Parameters:
-
keyTransRecipientInfo
- key trans recipient info wrapper to create recipient info wrapper from - Returns:
- created recipient info wrapper
-
createEncryptedContentInfo
public IEncryptedContentInfo createEncryptedContentInfo(IASN1ObjectIdentifier data, IAlgorithmIdentifier algorithmIdentifier, IASN1OctetString octetString) Create encrypted content info wrapper from ASN1 Object identifier wrapper, algorithm identifier wrapper and ASN1 Octet string wrapper.- Specified by:
-
createEncryptedContentInfo
in interfaceIBouncyCastleFactory
- Parameters:
-
data
- ASN1 Object identifier wrapper to create encrypted content info wrapper from -
algorithmIdentifier
- algorithm identifier wrapper to create encrypted content info wrapper from -
octetString
- ASN1 Octet string wrapper to create encrypted content info wrapper from - Returns:
- created encrypted content info wrapper
-
createTBSCertificate
Create TBS Certificate wrapper from ASN1 Encodable wrapper.- Specified by:
-
createTBSCertificate
in interfaceIBouncyCastleFactory
- Parameters:
-
encodable
- ASN1 Encodable wrapper to create TBS Certificate wrapper from - Returns:
- created TBS Certificate wrapper
-
createTBSCertificate
Create TBS Certificate wrapper from ASN1 Encoded data.- Specified by:
-
createTBSCertificate
in interfaceIBouncyCastleFactory
- Parameters:
-
bytes
- ASN1 Encoded TBS Certificate - Returns:
- created TBS Certificate wrapper
-
createIssuerAndSerialNumber
Create issuer and serial number wrapper from X500 Name wrapper andBigInteger
.- Specified by:
-
createIssuerAndSerialNumber
in interfaceIBouncyCastleFactory
- Parameters:
-
issuer
- X500 Name wrapper to create issuer and serial number wrapper from -
value
-BigInteger
to create issuer and serial number wrapper from - Returns:
- created issuer and serial number wrapper
-
createRecipientIdentifier
public IRecipientIdentifier createRecipientIdentifier(IIssuerAndSerialNumber issuerAndSerialNumber) Create recipient identifier wrapper from issuer and serial number wrapper.- Specified by:
-
createRecipientIdentifier
in interfaceIBouncyCastleFactory
- Parameters:
-
issuerAndSerialNumber
- issuer and serial number wrapper to create recipient identifier wrapper from - Returns:
- created recipient identifier wrapper
-
createKeyTransRecipientInfo
public IKeyTransRecipientInfo createKeyTransRecipientInfo(IRecipientIdentifier recipientIdentifier, IAlgorithmIdentifier algorithmIdentifier, IASN1OctetString octetString) Create key trans recipient info wrapper from recipient identifier wrapper, algorithm identifier wrapper and ASN1 Octet string wrapper.- Specified by:
-
createKeyTransRecipientInfo
in interfaceIBouncyCastleFactory
- Parameters:
-
recipientIdentifier
- recipient identifier wrapper to create key trans recipient info wrapper from -
algorithmIdentifier
- algorithm identifier wrapper to create key trans recipient info wrapper from -
octetString
- ASN1 Octet string wrapper to create key trans recipient info wrapper from - Returns:
- created key trans recipient info wrapper
-
createNullOriginatorInfo
Create originator info wrapper withnull
value.- Specified by:
-
createNullOriginatorInfo
in interfaceIBouncyCastleFactory
- Returns:
- created originator info wrapper
-
createCMSEnvelopedData
Create CMS enveloped data frombyte[]
value.- Specified by:
-
createCMSEnvelopedData
in interfaceIBouncyCastleFactory
- Parameters:
-
bytes
-byte[]
value to create CMS enveloped data from - Returns:
- created CMS enveloped data
- Throws:
-
CMSExceptionBCFips
-
createTimeStampRequestGenerator
Create timestamp request generator wrapper without parameters.- Specified by:
-
createTimeStampRequestGenerator
in interfaceIBouncyCastleFactory
- Returns:
- created timestamp request generator wrapper
-
createTimeStampResponse
public ITimeStampResponse createTimeStampResponse(byte[] respBytes) throws TSPExceptionBCFips, IOException Create timestamp response wrapper frombyte[]
value.- Specified by:
-
createTimeStampResponse
in interfaceIBouncyCastleFactory
- Parameters:
-
respBytes
-byte[]
value to create timestamp response wrapper from - Returns:
- created timestamp response wrapper
- Throws:
-
IOException
- if input-output exception occurs during creation -
TSPExceptionBCFips
-
createAbstractOCSPException
Create OCSP Exception wrapper from usualException
.- Specified by:
-
createAbstractOCSPException
in interfaceIBouncyCastleFactory
- Parameters:
-
e
-Exception
to create OCSP Exception wrapper from - Returns:
- created OCSP Exception wrapper
-
createUnknownStatus
Create unknown status wrapper without parameters.- Specified by:
-
createUnknownStatus
in interfaceIBouncyCastleFactory
- Returns:
- created unknown status wrapper
-
createASN1Dump
Create ASN1 Dump wrapper without parameters.- Specified by:
-
createASN1Dump
in interfaceIBouncyCastleFactory
- Returns:
- created ASN1 Dump wrapper
-
createASN1BitString
Cast ASN1 Encodable wrapper to ASN1 Bit string wrapper.- Specified by:
-
createASN1BitString
in interfaceIBouncyCastleFactory
- Parameters:
-
encodable
- ASN1 Encodable wrapper to be cast - Returns:
- casted ASN1 Bit string wrapper
-
createASN1GeneralizedTime
Cast ASN1 Encodable wrapper to ASN1 Generalized time wrapper.- Specified by:
-
createASN1GeneralizedTime
in interfaceIBouncyCastleFactory
- Parameters:
-
encodable
- ASN1 Encodable wrapper to be cast - Returns:
- casted ASN1 Generalized time wrapper
-
createASN1UTCTime
Cast ASN1 Encodable wrapper to ASN1 UTC Time wrapper.- Specified by:
-
createASN1UTCTime
in interfaceIBouncyCastleFactory
- Parameters:
-
encodable
- ASN1 Encodable wrapper to be cast - Returns:
- casted ASN1 UTC Time wrapper
-
createJcaCertStore
public IJcaCertStore createJcaCertStore(List<Certificate> certificates) throws CertificateEncodingException Create Jca cert store wrapper fromList
ofCertificate
objects.- Specified by:
-
createJcaCertStore
in interfaceIBouncyCastleFactory
- Parameters:
-
certificates
-List
ofCertificate
objects to create Jca cert store wrapper from - Returns:
- created Jca cert store wrapper
- Throws:
-
CertificateEncodingException
- if certificate encoding exception occurs during wrapper creation
-
createTimeStampResponseGenerator
public ITimeStampResponseGenerator createTimeStampResponseGenerator(ITimeStampTokenGenerator tokenGenerator, Set<String> algorithms) Create timestamp response generator wrapper from timestamp token generator wrapper andSet
of algorithms.- Specified by:
-
createTimeStampResponseGenerator
in interfaceIBouncyCastleFactory
- Parameters:
-
tokenGenerator
- timestamp token generator wrapper to create timestamp response generator wrapper from -
algorithms
-Set
of algorithms to create timestamp response generator wrapper from - Returns:
- created timestamp response generator wrapper
-
createTimeStampRequest
Create timestamp request wrapper frombyte[]
value.- Specified by:
-
createTimeStampRequest
in interfaceIBouncyCastleFactory
- Parameters:
-
bytes
-byte[]
value to create timestamp request wrapper from - Returns:
- created timestamp request wrapper
- Throws:
-
IOException
- if input-output exception occurs during creation
-
createJcaContentSignerBuilder
Create Jca content signer builder wrapper fromString
algorithm.- Specified by:
-
createJcaContentSignerBuilder
in interfaceIBouncyCastleFactory
- Parameters:
-
algorithm
-String
algorithm to create Jca content signer builder wrapper from - Returns:
- created Jca content signer builder wrapper
-
createJcaSignerInfoGeneratorBuilder
public IJcaSignerInfoGeneratorBuilder createJcaSignerInfoGeneratorBuilder(IDigestCalculatorProvider digestCalcProviderProvider) Create Jca signer info generator builder wrapper from digest calculator provider wrapper.- Specified by:
-
createJcaSignerInfoGeneratorBuilder
in interfaceIBouncyCastleFactory
- Parameters:
-
digestCalcProviderProvider
- digest calculator provider wrapper to create builder wrapper from - Returns:
- created Jca signer info generator builder wrapper
-
createTimeStampTokenGenerator
public ITimeStampTokenGenerator createTimeStampTokenGenerator(ISignerInfoGenerator siGen, IDigestCalculator dgCalc, IASN1ObjectIdentifier policy) throws TSPExceptionBCFips Create timestamp token generator wrapper from signer info generator wrapper, digest calculator wrapper and ASN1 Object identifier wrapper.- Specified by:
-
createTimeStampTokenGenerator
in interfaceIBouncyCastleFactory
- Parameters:
-
siGen
- signer info generator wrapper to create timestamp token generator wrapper from -
dgCalc
- digest calculator wrapper to create timestamp token generator wrapper from -
policy
- ASN1 Object identifier wrapper to create timestamp token generator wrapper from - Returns:
- created timestamp token generator wrapper
- Throws:
-
TSPExceptionBCFips
-
createX500Name
Create X500 Name wrapper fromX509Certificate
.- Specified by:
-
createX500Name
in interfaceIBouncyCastleFactory
- Parameters:
-
certificate
-X509Certificate
to create X500 Name wrapper from - Returns:
- created X500 Name wrapper
- Throws:
-
CertificateEncodingException
- if certificate encoding exception occurs during wrapper creation
-
createX500Name
Create X500 Name wrapper fromString
.- Specified by:
-
createX500Name
in interfaceIBouncyCastleFactory
- Parameters:
-
s
-String
to create X500 Name wrapper from - Returns:
- created X500 Name wrapper
-
createRespID
Create resp ID wrapper from X500 Name wrapper.- Specified by:
-
createRespID
in interfaceIBouncyCastleFactory
- Parameters:
-
x500Name
- X500 Name wrapper to create resp ID wrapper from - Returns:
- created resp ID wrapper
-
createBasicOCSPRespBuilder
Create basic OCSP Resp builder wrapper from resp ID wrapper.- Specified by:
-
createBasicOCSPRespBuilder
in interfaceIBouncyCastleFactory
- Parameters:
-
respID
- resp ID wrapper to create basic OCSP Resp builder wrapper from - Returns:
- created basic OCSP Resp builder wrapper
-
createOCSPReq
Create OCSP Req wrapper frombyte[]
.- Specified by:
-
createOCSPReq
in interfaceIBouncyCastleFactory
- Parameters:
-
requestBytes
-byte[]
to create OCSP Req wrapper from - Returns:
- created OCSP Req wrapper
- Throws:
-
IOException
- if input-output exception occurs during creation
-
createX509v2CRLBuilder
Create X509 Version 2 CRL Builder wrapper from X500 Name wrapper andDate
.- Specified by:
-
createX509v2CRLBuilder
in interfaceIBouncyCastleFactory
- Parameters:
-
x500Name
- X500 Name wrapper to create X509 Version 2 CRL Builder wrapper from -
date
-Date
to create X509 Version 2 CRL Builder wrapper from - Returns:
- created X509 Version 2 CRL Builder wrapper
-
createJcaX509v3CertificateBuilder
public IJcaX509v3CertificateBuilder createJcaX509v3CertificateBuilder(X509Certificate signingCert, BigInteger certSerialNumber, Date startDate, Date endDate, IX500Name subjectDnName, PublicKey publicKey) Create Jca X509 Version 3 certificate builder wrapper fromX509Certificate
,BigInteger
, startDate
, endDate
, X500 Name wrapper andPublicKey
.- Specified by:
-
createJcaX509v3CertificateBuilder
in interfaceIBouncyCastleFactory
- Parameters:
-
signingCert
-X509Certificate
to create Jca X509 Version 3 certificate builder wrapper from -
certSerialNumber
-BigInteger
to create Jca X509 Version 3 certificate builder wrapper from -
startDate
- startDate
to create Jca X509 Version 3 certificate builder wrapper from -
endDate
- endDate
to create Jca X509 Version 3 certificate builder wrapper from -
subjectDnName
- X500 Name wrapper to create Jca X509 Version 3 certificate builder wrapper from -
publicKey
-PublicKey
to create Jca X509 Version 3 certificate builder wrapper from - Returns:
- created Jca X509 Version 3 certificate builder wrapper
-
createBasicConstraints
Create basic constraints wrapper fromboolean
value.- Specified by:
-
createBasicConstraints
in interfaceIBouncyCastleFactory
- Parameters:
-
b
-boolean
value to create basic constraints wrapper from - Returns:
- created basic constraints wrapper
-
createKeyUsage
Create key usage wrapper without parameters.- Specified by:
-
createKeyUsage
in interfaceIBouncyCastleFactory
- Returns:
- created key usage wrapper
-
createKeyUsage
Create key usage wrapper fromint
value.- Specified by:
-
createKeyUsage
in interfaceIBouncyCastleFactory
- Parameters:
-
i
-int
value to create key usage wrapper from - Returns:
- created key usage wrapper
-
createKeyPurposeId
Create key purpose id wrapper without parameters.- Specified by:
-
createKeyPurposeId
in interfaceIBouncyCastleFactory
- Returns:
- created key purpose id wrapper
-
createExtendedKeyUsage
Create extended key usage wrapper from key purpose id wrapper.- Specified by:
-
createExtendedKeyUsage
in interfaceIBouncyCastleFactory
- Parameters:
-
purposeId
- key purpose id wrapper to create extended key usage wrapper from - Returns:
- created extended key usage wrapper
-
createX509ExtensionUtils
Create X509 Extension utils wrapper from digest calculator wrapper.- Specified by:
-
createX509ExtensionUtils
in interfaceIBouncyCastleFactory
- Parameters:
-
digestCalculator
- digest calculator wrapper to create X509 Extension utils wrapper from - Returns:
- created X509 Extension utils wrapper
-
createSubjectPublicKeyInfo
Create subject public key info wrapper fromObject
.- Specified by:
-
createSubjectPublicKeyInfo
in interfaceIBouncyCastleFactory
- Parameters:
-
object
-Object
to create subject public ket info wrapper from - Returns:
- created subject public ket info wrapper
-
createCRLReason
Create CRL Reason wrapper without parameters.- Specified by:
-
createCRLReason
in interfaceIBouncyCastleFactory
- Returns:
- created CRL Reason wrapper
-
createTSTInfo
Create TST Info wrapper from content info wrapper.- Specified by:
-
createTSTInfo
in interfaceIBouncyCastleFactory
- Parameters:
-
contentInfo
- content info wrapper to create TST Info wrapper from - Returns:
- created TST Info wrapper
- Throws:
-
AbstractTSPException
- if actual TSP Exception occurs during wrapper creation -
IOException
- if input-output exception occurs during creation
-
createSingleResp
Create single resp wrapper from basic OCSP Response wrapper.- Specified by:
-
createSingleResp
in interfaceIBouncyCastleFactory
- Parameters:
-
basicResp
- basic OCSP Response wrapper to create single resp wrapper from - Returns:
- created single resp wrapper
-
createX509Certificate
CastObject
element toX509Certificate
.- Specified by:
-
createX509Certificate
in interfaceIBouncyCastleFactory
- Parameters:
-
element
-Object
to be cast - Returns:
-
casted
X509Certificate
-
getBouncyCastleFactoryTestUtil
GetIBouncyCastleTestConstantsFactory
corresponding to thisIBouncyCastleFactory
.- Specified by:
-
getBouncyCastleFactoryTestUtil
in interfaceIBouncyCastleFactory
- Returns:
-
IBouncyCastleTestConstantsFactory
instance
-
createNullCrl
Createnull
asCRL
object.- Specified by:
-
createNullCrl
in interfaceIBouncyCastleFactory
- Returns:
-
null
asCRL
object
-
createPEMParser
Create PEM Parser wrapper fromReader
.- Specified by:
-
createPEMParser
in interfaceIBouncyCastleFactory
- Parameters:
-
reader
-Reader
to create PEM Parser wrapper from - Returns:
- created PEM Parser wrapper
-
createJceOpenSSLPKCS8DecryptorProviderBuilder
Create Jce open SSL PKCS8 Decryptor provider builder wrapper without parameters.- Specified by:
-
createJceOpenSSLPKCS8DecryptorProviderBuilder
in interfaceIBouncyCastleFactory
- Returns:
- created Jce open SSL PKCS8 Decryptor provider builder wrapper
-
createJcaPEMKeyConverter
Create Jca PEM Key converter wrapper without parameters.- Specified by:
-
createJcaPEMKeyConverter
in interfaceIBouncyCastleFactory
- Returns:
- created Jca PEM Key converter wrapper
-
createTime
Create time wrapper fromDate
.- Specified by:
-
createTime
in interfaceIBouncyCastleFactory
- Parameters:
-
date
-Date
to create time wrapper from - Returns:
- created time wrapper
-
isNullExtension
Checks if provided extension wrapper wrapsnull
.- Specified by:
-
isNullExtension
in interfaceIBouncyCastleFactory
- Parameters:
-
ext
- extension wrapper to check - Returns:
-
true
if provided extension wrapper wrapsnull
,false
otherwise
-
isNull
Check if provided encodable wrapper wrapnull
.- Specified by:
-
isNull
in interfaceIBouncyCastleFactory
- Parameters:
-
encodable
- encodable wrapper to be checked - Returns:
-
true
if provided encodable wrapper wrapsnull
,false
otherwise
-
getSecureRandom
GetSecureRandom
implementation from the factory.- Specified by:
-
getSecureRandom
in interfaceIBouncyCastleFactory
- Returns:
-
SecureRandom
implementation
-
isInApprovedOnlyMode
public boolean isInApprovedOnlyMode()Check if this bouncy-castle corresponding to this factory is in approved mode.- Specified by:
-
isInApprovedOnlyMode
in interfaceIBouncyCastleFactory
- Returns:
-
true
if approved mode is enabled,false
otherwise
-
createCipherBytes
public byte[] createCipherBytes(X509Certificate x509certificate, byte[] abyte0, IAlgorithmIdentifier algorithmIdentifier) throws GeneralSecurityException Create cipher bytes fromX509Certificate
,byte[]
value and algorithm identifier wrapper.- Specified by:
-
createCipherBytes
in interfaceIBouncyCastleFactory
- Parameters:
-
x509certificate
-X509Certificate
to create cipher bytes from -
abyte0
-byte[]
value to create cipher bytes from -
algorithmIdentifier
- algorithm identifier wrapper to create cipher bytes from - Returns:
-
byte[]
representing created cipher bytes - Throws:
-
GeneralSecurityException
- if general security exception occurs during cipher bytes creation
-
isEncryptionFeatureSupported
public void isEncryptionFeatureSupported(int encryptionType, boolean withCertificate) Description copied from interface:IBouncyCastleFactory
Checks whether an algorithm is supported for encryption by the chosen Bouncy Castle implementation, throws an exception when not supported.- Specified by:
-
isEncryptionFeatureSupported
in interfaceIBouncyCastleFactory
- Parameters:
-
encryptionType
- the type of encryption. It can be one of STANDARD_ENCRYPTION_40 = 0 STANDARD_ENCRYPTION_128 = 1, ENCRYPTION_AES_128 = 2 ENCRYPTION_AES_256 = 3 in combination with (or-ed) DO_NOT_ENCRYPT_METADATA = 8 and EMBEDDED_FILES_ONLY = 24 -
withCertificate
- true when used with a certificate, false otherwise
-