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 
      Modifier and Type Class Description
      static class  KeyType.CertUtils  
      • Nested classes/interfaces inherited from class java.lang.Enum

        java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
    • 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)  
      KeyType getParent()  
      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
      • ED25519_CERT

        public static final KeyType ED25519_CERT
      • ECDSA256_CERT

        public static final KeyType ECDSA256_CERT
      • ECDSA384_CERT

        public static final KeyType ECDSA384_CERT
      • ECDSA521_CERT

        public static final KeyType ECDSA521_CERT
      • 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)
      • getParent

        public KeyType getParent()
      • fromString

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

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