Package net.visma.autopay.http.signature
Class PublicKeyInfo.Builder
java.lang.Object
net.visma.autopay.http.signature.PublicKeyInfo.Builder
- Enclosing class:
- PublicKeyInfo
Builder class to build
PublicKeyInfo
objects.
Public key can be provided as either PublicKey
object or X.509-encoded byte[] or X.509-Base64-encoded String.
-
Method Summary
Modifier and TypeMethodDescriptionalgorithm
(SignatureAlgorithm algorithm) Sets signature algorithm for the key.build()
ConstructsPublicKeyInfo
object from this builderpublicKey
(byte[] publicKey) Encoded public key provided as bytes[] objectEncoded public key provided as String objectPublic key provided as an object
-
Method Details
-
algorithm
Sets signature algorithm for the key.The algorithm must be provided here or as alg parameter in Signature-Input header.
- Parameters:
algorithm
- Signature algorithm used to verify the signature- Returns:
- This builder
-
publicKey
Public key provided as an object- Parameters:
publicKey
- Public key to verify the signature- Returns:
- This builder
-
publicKey
Encoded public key provided as bytes[] object- Parameters:
publicKey
- X.509-encoded public key- Returns:
- This builder
- See Also:
-
publicKey
Encoded public key provided as String objectIt must be in X.509 format. It can contain multiple lines, including BEGIN PUBLIC KEY and END PUBLIC KEY. PKCS#1 format, like "BEGIN RSA PUBLIC KEY" is not accepted.
- Parameters:
publicKey
- X.509-base-64-encoded public key- Returns:
- This builder
-
build
ConstructsPublicKeyInfo
object from this builderPublic key data must be provided using any of publicKey() builder methods
- Returns:
- PublicKeyInfo object
-