Interface PublicKeyRawDataDecoder<PUB extends java.security.PublicKey>

    • Method Detail

      • decodePublicKey

        default PUB decodePublicKey​(SessionContext session,
                                    java.lang.String keyType,
                                    byte[] keyData,
                                    java.util.Map<java.lang.String,​java.lang.String> headers)
                             throws java.io.IOException,
                                    java.security.GeneralSecurityException
        Parameters:
        session - The SessionContext for invoking this command - may be null if not invoked within a session context (e.g., offline tool or session unknown).
        keyType - The OpenSSH reported key type
        keyData - The key data bytes in OpenSSH format (after BASE64 decoding) - ignored if null/empty
        headers - Any headers that may have been available when data was read
        Returns:
        The decoded PublicKey - or null if no data
        Throws:
        java.io.IOException - If failed to decode the key
        java.security.GeneralSecurityException - If failed to generate the key
      • decodePublicKey

        default PUB decodePublicKey​(SessionContext session,
                                    java.lang.String keyType,
                                    byte[] keyData,
                                    int offset,
                                    int length,
                                    java.util.Map<java.lang.String,​java.lang.String> headers)
                             throws java.io.IOException,
                                    java.security.GeneralSecurityException
        Throws:
        java.io.IOException
        java.security.GeneralSecurityException
      • decodePublicKeyByType

        PUB decodePublicKeyByType​(SessionContext session,
                                  java.lang.String keyType,
                                  java.io.InputStream keyData,
                                  java.util.Map<java.lang.String,​java.lang.String> headers)
                           throws java.io.IOException,
                                  java.security.GeneralSecurityException
        Throws:
        java.io.IOException
        java.security.GeneralSecurityException
      • decodePublicKey

        PUB decodePublicKey​(SessionContext session,
                            java.lang.String keyType,
                            java.io.InputStream keyData,
                            java.util.Map<java.lang.String,​java.lang.String> headers)
                     throws java.io.IOException,
                            java.security.GeneralSecurityException
        Parameters:
        session - The SessionContext for invoking this command - may be null if not invoked within a session context (e.g., offline tool or session unknown).
        keyType - The reported / encode key type
        keyData - The key data bytes stream positioned after the key type decoding and making sure it is one of the supported types
        headers - Any headers that may have been available when data was read
        Returns:
        The decoded PublicKey
        Throws:
        java.io.IOException - If failed to read from the data stream
        java.security.GeneralSecurityException - If failed to generate the key