Package com.google.crypto.tink.signature
Class SignatureJwkSetConverter
- java.lang.Object
-
- com.google.crypto.tink.signature.SignatureJwkSetConverter
-
public final class SignatureJwkSetConverter extends java.lang.ObjectProvides functions to import and export public Json Web Key (JWK) sets for normal (non-JWT) signature keys.The currently supported algorithms are ES256, ES384, ES512, EdDSA, RS256, RS384, RS512, PS256, PS384 and PS512.
Only keys with
NO_PREFIXvariant are supported for export. All imported keys will haveNO_PREFIXvariant, and thekidfield in the JWK will be ignored.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringfromPublicKeysetHandle(KeysetHandle handle)Converts a Tink KeysetHandle with public signature keys into a Json Web Key (JWK) set.static KeysetHandletoPublicKeysetHandle(java.lang.String jwkSet)Converts a Json Web Key (JWK) set with public keys into a Tink KeysetHandle.
-
-
-
Method Detail
-
fromPublicKeysetHandle
public static java.lang.String fromPublicKeysetHandle(KeysetHandle handle) throws java.security.GeneralSecurityException
Converts a Tink KeysetHandle with public signature keys into a Json Web Key (JWK) set.Only keys with
NO_PREFIXvariant are supported. For other variants, aGeneralSecurityExceptionis thrown.- Throws:
java.security.GeneralSecurityException
-
toPublicKeysetHandle
public static KeysetHandle toPublicKeysetHandle(java.lang.String jwkSet) throws java.security.GeneralSecurityException
Converts a Json Web Key (JWK) set with public keys into a Tink KeysetHandle.All imported keys will have
NO_PREFIXvariant. Thekidfield in the JWK (if present) will be ignored.- Throws:
java.security.GeneralSecurityException
-
-