Enum KeyType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<KeyType>, java.lang.constant.Constable

    public enum KeyType
    extends java.lang.Enum<KeyType>
    Type of key e.g. rsa, dsa
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Enum

        java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      DSA
      SSH identifier for DSA keys
      DSA_CERT
      Signed dsa certificate
      ECDSA256
      SSH identifier for ECDSA-256 keys
      ECDSA384
      SSH identifier for ECDSA-384 keys
      ECDSA521
      SSH identifier for ECDSA-521 keys
      ED25519  
      RSA
      SSH identifier for RSA keys
      RSA_CERT
      Signed rsa certificate
      UNKNOWN
      Unrecognized
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String sType  
    • Method Summary

      Modifier and Type Method Description
      static KeyType fromKey​(java.security.Key key)  
      static KeyType fromString​(java.lang.String sType)  
      protected abstract boolean isMyType​(java.security.Key key)  
      void putPubKeyIntoBuffer​(java.security.PublicKey pk, Buffer<?> buf)  
      abstract java.security.PublicKey readPubKeyFromBuffer​(Buffer<?> buf)  
      java.lang.String toString()  
      static KeyType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static KeyType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      protected abstract void writePubKeyContentsIntoBuffer​(java.security.PublicKey pk, Buffer<?> buf)  
      • Methods inherited from class java.lang.Enum

        clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • RSA

        public static final KeyType RSA
        SSH identifier for RSA keys
      • DSA

        public static final KeyType DSA
        SSH identifier for DSA keys
      • ECDSA256

        public static final KeyType ECDSA256
        SSH identifier for ECDSA-256 keys
      • ECDSA384

        public static final KeyType ECDSA384
        SSH identifier for ECDSA-384 keys
      • ECDSA521

        public static final KeyType ECDSA521
        SSH identifier for ECDSA-521 keys
      • ED25519

        public static final KeyType ED25519
      • RSA_CERT

        public static final KeyType RSA_CERT
        Signed rsa certificate
      • DSA_CERT

        public static final KeyType DSA_CERT
        Signed dsa certificate
      • UNKNOWN

        public static final KeyType UNKNOWN
        Unrecognized
    • Field Detail

      • sType

        protected final java.lang.String sType
    • Method Detail

      • values

        public static KeyType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared.
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static KeyType 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
      • readPubKeyFromBuffer

        public abstract java.security.PublicKey readPubKeyFromBuffer​(Buffer<?> buf)
                                                              throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException
      • writePubKeyContentsIntoBuffer

        protected abstract void writePubKeyContentsIntoBuffer​(java.security.PublicKey pk,
                                                              Buffer<?> buf)
      • putPubKeyIntoBuffer

        public void putPubKeyIntoBuffer​(java.security.PublicKey pk,
                                        Buffer<?> buf)
      • isMyType

        protected abstract boolean isMyType​(java.security.Key key)
      • fromKey

        public static KeyType fromKey​(java.security.Key key)
      • fromString

        public static KeyType fromString​(java.lang.String sType)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<KeyType>