Enum BuiltinIdentities

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  BuiltinIdentities.Constants
      Contains the names of the identities
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      DSA  
      ECDSA  
      ED25119  
      RSA  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String algorithm  
      private java.lang.String name  
      static java.util.NavigableSet<java.lang.String> NAMES
      A case insensitive NavigableSet of all built-in identities names
      private java.lang.Class<? extends java.security.PrivateKey> prvType  
      private java.lang.Class<? extends java.security.PublicKey> pubType  
      private java.util.NavigableSet<java.lang.String> types  
      static java.util.Set<BuiltinIdentities> VALUES  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private BuiltinIdentities​(java.lang.String type, java.lang.Class<? extends java.security.PublicKey> pubType, java.lang.Class<? extends java.security.PrivateKey> prvType, java.lang.String keyType)  
      private BuiltinIdentities​(java.lang.String name, java.lang.String algorithm, java.lang.Class<? extends java.security.PublicKey> pubType, java.lang.Class<? extends java.security.PrivateKey> prvType, java.lang.String keyType)  
      private BuiltinIdentities​(java.lang.String name, java.lang.String algorithm, java.lang.Class<? extends java.security.PublicKey> pubType, java.lang.Class<? extends java.security.PrivateKey> prvType, java.util.Collection<java.lang.String> keyTypes)  
    • Field Detail

      • NAMES

        public static final java.util.NavigableSet<java.lang.String> NAMES
        A case insensitive NavigableSet of all built-in identities names
      • name

        private final java.lang.String name
      • algorithm

        private final java.lang.String algorithm
      • pubType

        private final java.lang.Class<? extends java.security.PublicKey> pubType
      • prvType

        private final java.lang.Class<? extends java.security.PrivateKey> prvType
      • types

        private final java.util.NavigableSet<java.lang.String> types
    • Constructor Detail

      • BuiltinIdentities

        private BuiltinIdentities​(java.lang.String type,
                                  java.lang.Class<? extends java.security.PublicKey> pubType,
                                  java.lang.Class<? extends java.security.PrivateKey> prvType,
                                  java.lang.String keyType)
      • BuiltinIdentities

        private BuiltinIdentities​(java.lang.String name,
                                  java.lang.String algorithm,
                                  java.lang.Class<? extends java.security.PublicKey> pubType,
                                  java.lang.Class<? extends java.security.PrivateKey> prvType,
                                  java.lang.String keyType)
      • BuiltinIdentities

        private BuiltinIdentities​(java.lang.String name,
                                  java.lang.String algorithm,
                                  java.lang.Class<? extends java.security.PublicKey> pubType,
                                  java.lang.Class<? extends java.security.PrivateKey> prvType,
                                  java.util.Collection<java.lang.String> keyTypes)
    • Method Detail

      • values

        public static BuiltinIdentities[] 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 (BuiltinIdentities c : BuiltinIdentities.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static BuiltinIdentities 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
      • getName

        public final java.lang.String getName()
        Specified by:
        getName in interface NamedResource
        Returns:
        The resource name
      • getSupportedKeyTypes

        public java.util.NavigableSet<java.lang.String> getSupportedKeyTypes()
        Specified by:
        getSupportedKeyTypes in interface KeyTypeNamesSupport
        Returns:
        The case insensitive NavigableSet of OpenSSH key type names that are supported by this decoder - e.g., ssh-rsa, ssh-dss, ecdsa-sha2-nistp384. This is not a single name - e.g., ECDSA keys have several curve names. Caveat: this collection may be un-modifiable...
      • getPublicKeyType

        public final java.lang.Class<? extends java.security.PublicKey> getPublicKeyType()
        Specified by:
        getPublicKeyType in interface Identity
      • getPrivateKeyType

        public final java.lang.Class<? extends java.security.PrivateKey> getPrivateKeyType()
        Specified by:
        getPrivateKeyType in interface Identity
      • fromName

        public static BuiltinIdentities fromName​(java.lang.String name)
        Parameters:
        name - The identity name - ignored if null/empty
        Returns:
        The matching BuiltinIdentities whose getName() value matches case insensitive or null if no match found
      • fromAlgorithm

        public static BuiltinIdentities fromAlgorithm​(java.lang.String algorithm)
        Parameters:
        algorithm - The algorithm - ignored if null/empty
        Returns:
        The matching BuiltinIdentities whose getAlgorithm() value matches case insensitive or null if no match found
      • fromKeyPair

        public static BuiltinIdentities fromKeyPair​(java.security.KeyPair kp)
        Parameters:
        kp - The KeyPair - ignored if null
        Returns:
        The matching BuiltinIdentities provided both public and public keys are of the same type - null if no match could be found
        See Also:
        fromKey(Key)
      • fromKey

        public static BuiltinIdentities fromKey​(java.security.Key key)
        Parameters:
        key - The Key instance - ignored if null
        Returns:
        The matching BuiltinIdentities whose either public or private key type matches the requested one or null if no match found
        See Also:
        fromKeyType(Class)