Enum PemKeyType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<PemKeyType>

    public enum PemKeyType
    extends java.lang.Enum<PemKeyType>
    PEM key types that Tink supports
    • Enum Constant Detail

      • RSA_PSS_2048_SHA256

        public static final PemKeyType RSA_PSS_2048_SHA256
      • RSA_PSS_3072_SHA256

        public static final PemKeyType RSA_PSS_3072_SHA256
      • RSA_PSS_4096_SHA256

        public static final PemKeyType RSA_PSS_4096_SHA256
      • RSA_PSS_4096_SHA512

        public static final PemKeyType RSA_PSS_4096_SHA512
      • RSA_SIGN_PKCS1_2048_SHA256

        public static final PemKeyType RSA_SIGN_PKCS1_2048_SHA256
      • RSA_SIGN_PKCS1_3072_SHA256

        public static final PemKeyType RSA_SIGN_PKCS1_3072_SHA256
      • RSA_SIGN_PKCS1_4096_SHA256

        public static final PemKeyType RSA_SIGN_PKCS1_4096_SHA256
      • RSA_SIGN_PKCS1_4096_SHA512

        public static final PemKeyType RSA_SIGN_PKCS1_4096_SHA512
      • ECDSA_P256_SHA256

        public static final PemKeyType ECDSA_P256_SHA256
      • ECDSA_P384_SHA384

        public static final PemKeyType ECDSA_P384_SHA384
      • ECDSA_P521_SHA512

        public static final PemKeyType ECDSA_P521_SHA512
    • Field Detail

      • keyType

        public final java.lang.String keyType
      • algorithm

        public final java.lang.String algorithm
      • keySizeInBits

        public final int keySizeInBits
    • Method Detail

      • values

        public static PemKeyType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (PemKeyType c : PemKeyType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static PemKeyType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • readKey

        @Nullable
        public java.security.Key readKey​(java.io.BufferedReader reader)
                                  throws java.io.IOException
        Reads a single key from reader.
        Returns:
        a Key or null if the reader doesn't contain a valid PEM.
        Throws:
        java.io.IOException