Class SignatureRSA

    • Field Detail

      • SUPPORTED_KEY_TYPES

        public static final java.util.NavigableSet<java.lang.String> SUPPORTED_KEY_TYPES
      • verifierSignatureSize

        private int verifierSignatureSize
      • sshAlgorithmName

        private final java.lang.String sshAlgorithmName
    • Constructor Detail

      • SignatureRSA

        protected SignatureRSA​(java.lang.String algorithm,
                               java.lang.String sshAlgorithmName)
    • Method Detail

      • getSshAlgorithmName

        public java.lang.String getSshAlgorithmName​(java.lang.String algo)
        Parameters:
        algo - - the negotiated value
        Returns:
        The original ssh name of the signature algorithm
      • getVerifierSignatureSize

        protected int getVerifierSignatureSize()
        Returns:
        The expected number of bytes in the signature - non-positive if not initialized or not intended to be used for verification
      • initVerifier

        public void initVerifier​(SessionContext session,
                                 java.security.PublicKey key)
                          throws java.lang.Exception
        Specified by:
        initVerifier in interface Signature
        Overrides:
        initVerifier in class AbstractSignature
        Parameters:
        session - The SessionContext for calling this method - may be null if not called within a session context
        key - The PublicKey to be used for verifying signatures
        Throws:
        java.lang.Exception - If failed to initialize
      • getVerifierSignatureSize

        public static int getVerifierSignatureSize​(java.security.interfaces.RSAKey key)
      • verify

        public boolean verify​(SessionContext session,
                              byte[] sig)
                       throws java.lang.Exception
        Description copied from interface: Signature
        Verify against the given signature
        Parameters:
        session - The SessionContext for calling this method - may be null if not called within a session context
        sig - The signed data
        Returns:
        true if signature is valid
        Throws:
        java.lang.Exception - If failed to extract signed data for validation