java_src/src/main/java/com/google/crypto/tink/Registry.java
/**
   * Method to derive a key, using the given {@code keyTemplate}, with the randomness as provided by
   * the second argument.
   *
   * <p>This method is on purpose not in the public interface. Calling it twice using different key
   * templates and the same randomness can completely destroy any security in a system, so we
   * prevent this by making it accessible only to safe call sites.
   *
   * <p>This functions ignores {@code keyTemplate.getOutputPrefix()}.
   */
Method to derive a key, using the given  keyTemplate, with the randomness as provided by
the second argument.

This method is on purpose not in the public interface. Calling it twice using different key
templates and the same randomness can completely destroy any security in a system, so we
prevent this by making it accessible only to safe call sites.


Method to derive a key using the given keyTemplate with the randomness as provided by the second argument . This method is on purpose not in the public interface . Calling it twice using different key templates and the same randomness can completely destroy any security in a system so we prevent this by making it accessible only to safe call sites .
static synchronized KeyData deriveKey(
      com.google.crypto.tink.proto.KeyTemplate keyTemplate, InputStream randomStream)
      throws GeneralSecurityException {
    String typeUrl = keyTemplate.getTypeUrl();
    if (!keyDeriverMap.containsKey(typeUrl)) {
      throw new GeneralSecurityException(
          "No keymanager registered or key manager cannot derive keys for " + typeUrl);
    }
    KeyDeriverContainer deriver = keyDeriverMap.get(typeUrl);
    return deriver.deriveKey(keyTemplate.getValue(), randomStream);
  }
static synchronized KeyData deriveKey ( com . google . crypto . tink . proto . KeyTemplate keyTemplate , InputStream randomStream ) throws GeneralSecurityException { String typeUrl = keyTemplate . getTypeUrl ( ) ; if ( ! keyDeriverMap . containsKey ( typeUrl ) ) { throw new GeneralSecurityException ( "No keymanager registered or key manager cannot derive keys for " + typeUrl ) ; } KeyDeriverContainer deriver = keyDeriverMap . get ( typeUrl ) ; return deriver . deriveKey ( keyTemplate . getValue ( ) , randomStream ) ; }
Method to derive a key, using the given {@code keyTemplate}, with the randomness as provided by
 the second argument.
Method to derive a key using the given { @code keyTemplate } with the randomness as provided by the second argument .