- Type Parameters:
B
- builder type
- All Superinterfaces:
WebCertificateReference.Builder<B>
,WebKeyReference.Builder<B>
- All Known Implementing Classes:
JwkBuilder
- Enclosing interface:
WebKey
public static interface WebKey.Builder<B extends WebKey.Builder<B>>
extends WebKeyReference.Builder<B>
Builder interface for creating
WebKey
instances.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the web key.Generates a public/private key pair for the algorithm specified byWebKeyReference.Builder.algorithm(Algorithm)
using the default size.ephemeral
(WebEncryption.Encryption encryption) Generates an ephemeral content encryption key.ephemeral
(WebKey.Algorithm algorithm) Generates a public/private key pair or secret key without settingWebKeyReference.Builder.algorithm(edu.iu.crypt.WebKey.Algorithm)
.key
(byte[] key) Adds raw key data.Sets both public and private keys from aKeyPair
.key
(PrivateKey privateKey) Adds private key parameters.Adds public key parameters.ops
(WebKey.Operation... ops) Sets the key operations.type
(WebKey.Type type) Sets the key type.use
(WebKey.Use use) Sets the public key use.Methods inherited from interface edu.iu.crypt.WebCertificateReference.Builder
cert, cert, pem, pem, x5t, x5t256
Methods inherited from interface edu.iu.crypt.WebKeyReference.Builder
algorithm, keyId
-
Method Details
-
type
Sets the key type.- Parameters:
type
- key type- Returns:
- this
-
use
Sets the public key use.- Parameters:
use
- public key use- Returns:
- this
-
ops
Sets the key operations.- Parameters:
ops
- key operations- Returns:
- this
-
ephemeral
B ephemeral()Generates a public/private key pair for the algorithm specified byWebKeyReference.Builder.algorithm(Algorithm)
using the default size.- Returns:
- this
-
ephemeral
Generates a public/private key pair or secret key without settingWebKeyReference.Builder.algorithm(edu.iu.crypt.WebKey.Algorithm)
.- Parameters:
algorithm
- algorithm the key will be used with- Returns:
- this
-
ephemeral
Generates an ephemeral content encryption key.- Parameters:
encryption
- content encryption algorithm- Returns:
- this
-
key
Adds raw key data.- Parameters:
key
- raw key data- Returns:
- this
-
key
Adds public key parameters.- Parameters:
publicKey
- public key- Returns:
- this
-
key
Adds private key parameters.- Parameters:
privateKey
- private key- Returns:
- this
-
key
Sets both public and private keys from aKeyPair
.- Parameters:
keyPair
- key pair;- Returns:
- this
-
build
WebKey build()Builds the web key.- Returns:
WebKey
-