Class JsonWebSecretKey.Builder
java.lang.Object
de.christofreichardt.json.webkey.JsonWebKey.Builder<JsonWebSecretKey.Builder>
de.christofreichardt.json.webkey.JsonWebSecretKey.Builder
- Enclosing class:
JsonWebSecretKey
A
JsonWebKey.Builder for building JsonWebSecretKeys by specifying an algorithm and a keysize.- Author:
- Christof Reichardt
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theJsonWebSecretKeywith the configured parameters.withAlgorithm(String algorithm) Indicates thealgorithmto be used when generating theSecretKey.withKeysize(int keysize) Indicates thekeysizeto be used when generating theSecretKey.Methods inherited from class JsonWebKey.Builder
withKid
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
withKeysize
Indicates thekeysizeto be used when generating theSecretKey.- Parameters:
keysize- the to be usedkeysize- Returns:
- this
JsonWebSecretKey.Builderinstance
-
withAlgorithm
Indicates thealgorithmto be used when generating theSecretKey.- Parameters:
algorithm- the to be usedalgorithm- Returns:
- this
JsonWebSecretKey.Builderinstance - Throws:
NoSuchAlgorithmException- if the requested algorithm is not supported
-
build
Builds theJsonWebSecretKeywith the configured parameters.- Returns:
- the appropriately configured
JsonWebSecretKeyinstance - Throws:
NoSuchAlgorithmException- relayed from the underlying "Java Cryptography Architecture"
-