Class JceTlsSecret

  • All Implemented Interfaces:
    TlsSecret

    public class JceTlsSecret
    extends AbstractTlsSecret
    JCE support class for handling TLS secrets and deriving key material and other secrets from them.
    • Constructor Detail

      • JceTlsSecret

        public JceTlsSecret​(JcaTlsCrypto crypto,
                            byte[] data)
    • Method Detail

      • deriveUsingPRF

        public TlsSecret deriveUsingPRF​(int prfAlgorithm,
                                        java.lang.String label,
                                        byte[] seed,
                                        int length)
        Description copied from interface: TlsSecret
        Return a new secret based on applying a PRF to this one.
        Parameters:
        prfAlgorithm - PRF algorithm to use.
        label - the label details.
        seed - the seed details.
        length - the size (in bytes) of the secret to generate.
        Returns:
        the new secret.
      • hmacHash

        protected void hmacHash​(java.lang.String digestName,
                                byte[] secret,
                                int secretOff,
                                int secretLen,
                                byte[] seed,
                                byte[] output)
                         throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException
      • prf_1_0

        protected byte[] prf_1_0​(byte[] secret,
                                 byte[] labelSeed,
                                 int length)
                          throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException
      • prf_1_2

        protected byte[] prf_1_2​(int prfAlgorithm,
                                 byte[] secret,
                                 byte[] labelSeed,
                                 int length)
                          throws java.security.GeneralSecurityException
        Throws:
        java.security.GeneralSecurityException