Class SignatureJwkSetConverter


  • public final class SignatureJwkSetConverter
    extends java.lang.Object
    Provides 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_PREFIX variant are supported for export. All imported keys will have NO_PREFIX variant, and the kid field in the JWK will be ignored.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String fromPublicKeysetHandle​(KeysetHandle handle)
      Converts a Tink KeysetHandle with public signature keys into a Json Web Key (JWK) set.
      static KeysetHandle toPublicKeysetHandle​(java.lang.String jwkSet)
      Converts a Json Web Key (JWK) set with public keys into a Tink KeysetHandle.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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_PREFIX variant are supported. For other variants, a GeneralSecurityException is 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_PREFIX variant. The kid field in the JWK (if present) will be ignored.

        Throws:
        java.security.GeneralSecurityException