Package org.webpki.cbor
Class CBORAsymKeySigner
java.lang.Object
org.webpki.cbor.CBORSigner
org.webpki.cbor.CBORAsymKeySigner
Class for creating CBOR asymmetric key signatures.
Also see CBORSigner
.
Note that asymmetric key signatures do not permit using
both a keyId
and an in-line public key.
Also see CBORSigner.setKeyId(CBORObject)
and setPublicKey(PublicKey)
.
-
Constructor Summary
ConstructorDescriptionCBORAsymKeySigner
(PrivateKey privateKey) Initializes a signer with a private key.CBORAsymKeySigner
(PrivateKey privateKey, AsymSignatureAlgorithms algorithm) Initializes a signer with a private key.Initializes a signer with an external interface. -
Method Summary
Modifier and TypeMethodDescriptionsetPublicKey
(PublicKey publicKey) Puts a public key into the signature container.Methods inherited from class org.webpki.cbor.CBORSigner
setCloneMode, setIntercepter, setKeyId, setProvider, sign
-
Constructor Details
-
CBORAsymKeySigner
Initializes a signer with an external interface.- Parameters:
signer
- Custom signer
-
CBORAsymKeySigner
Initializes a signer with a private key.The default signature algorithm to use is based on the recommendations in RFC 7518.
- Parameters:
privateKey
- Signature key
-
CBORAsymKeySigner
Initializes a signer with a private key.- Parameters:
privateKey
- Signature keyalgorithm
- Signature algorithm
-
-
Method Details
-
setPublicKey
Puts a public key into the signature container.Note that a public key value of
null
is equivalent to the default (=no public key).- Parameters:
publicKey
- The public key ornull
- Returns:
this
-