Пример #1
0
 static byte[] doTLS12PRF(
     byte[] secret,
     byte[] labelBytes,
     byte[] seed,
     int outputLength,
     String prfHash,
     int prfHashLength,
     int prfBlockSize)
     throws NoSuchAlgorithmException, DigestException {
   if (prfHash == null) {
     throw new NoSuchAlgorithmException("Unspecified PRF algorithm");
   }
   MessageDigest prfMD = MessageDigest.getInstance(prfHash);
   return doTLS12PRF(secret, labelBytes, seed, outputLength, prfMD, prfHashLength, prfBlockSize);
 }
Пример #2
0
 static byte[] doTLS10PRF(byte[] secret, byte[] labelBytes, byte[] seed, int outputLength)
     throws NoSuchAlgorithmException, DigestException {
   MessageDigest md5 = MessageDigest.getInstance("MD5");
   MessageDigest sha = MessageDigest.getInstance("SHA1");
   return doTLS10PRF(secret, labelBytes, seed, outputLength, md5, sha);
 }