Class JwkSetConverter


  • public final class JwkSetConverter
    extends java.lang.Object
    Provides functions to import and export public Json Web Key (JWK) sets.

    The currently supported algorithms are ES256, ES384, ES512, RS256, RS384, RS512, PS256, PS384 and PS512.

    • Method Detail

      • fromPublicKeysetHandle

        public static java.lang.String fromPublicKeysetHandle​(KeysetHandle handle)
                                                       throws java.io.IOException,
                                                              java.security.GeneralSecurityException
        Converts a Tink KeysetHandle with JWT public keys into a Json Web Key (JWK) set.

        The currently supported algorithms are ES256, ES384, ES512, RS256, RS384, RS512, PS256, PS384 and PS512. JWK is defined in https://www.rfc-editor.org/rfc/rfc7517.txt.

        Throws:
        java.io.IOException
        java.security.GeneralSecurityException
      • toPublicKeysetHandle

        public static KeysetHandle toPublicKeysetHandle​(java.lang.String jwkSet)
                                                 throws java.io.IOException,
                                                        java.security.GeneralSecurityException
        Converts a Json Web Key (JWK) set with public keys into a Tink KeysetHandle.

        It requires that all keys in the set have the "alg" field set. The currently supported algorithms are ES256, ES384, ES512, RS256, RS384, RS512, PS256, PS384 and PS512. JWK is defined in https://www.rfc-editor.org/rfc/rfc7517.txt.

        Throws:
        java.io.IOException
        java.security.GeneralSecurityException
      • fromKeysetHandle

        @InlineMe(replacement="JwkSetConverter.fromPublicKeysetHandle(handle)",
                  imports="com.google.crypto.tink.jwt.JwkSetConverter")
        @Deprecated
        public static java.lang.String fromKeysetHandle​(KeysetHandle handle,
                                                        KeyAccess keyAccess)
                                                 throws java.io.IOException,
                                                        java.security.GeneralSecurityException
        Deprecated.
        Use JwkSetConverter.fromPublicKeysetHandle(handle) instead.
        Throws:
        java.io.IOException
        java.security.GeneralSecurityException
      • toKeysetHandle

        @InlineMe(replacement="JwkSetConverter.toPublicKeysetHandle(jwkSet)",
                  imports="com.google.crypto.tink.jwt.JwkSetConverter")
        @Deprecated
        public static KeysetHandle toKeysetHandle​(java.lang.String jwkSet,
                                                  KeyAccess keyAccess)
                                           throws java.io.IOException,
                                                  java.security.GeneralSecurityException
        Deprecated.
        Use JwkSetConverter.toPublicKeysetHandle(jwkSet) instead.
        Throws:
        java.io.IOException
        java.security.GeneralSecurityException