java_src/src/main/java/com/google/crypto/tink/Registry.java
/**
   * Tries to register {@code manager} for {@code manager.getKeyType()}. If {@code newKeyAllowed} is
   * true, users can generate new keys with this manager using the {@link Registry#newKey} methods.
   *
   * <p>If there is an existing key manager, throws an exception if {@code manager} and the existing
   * key manager aren't instances of the same class, or if {@code newKeyAllowed} is true while the
   * existing key manager could not create new keys.  Otherwise registration succeeds.
   *
   * @throws GeneralSecurityException if there's an existing key manager is not an instance
   *     of the class of {@code manager}, or the registration tries to re-enable the generation
   *     of new keys.
   */
Tries to register  manager for  manager.getKeyType(). If  newKeyAllowed is
true, users can generate new keys with this manager using the  Registry#newKey methods.

If there is an existing key manager, throws an exception if  manager and the existing
key manager aren't instances of the same class, or if  newKeyAllowed is true while the
existing key manager could not create new keys.  Otherwise registration succeeds.

@throws GeneralSecurityException if there's an existing key manager is not an instance
of the class of  manager, or the registration tries to re-enable the generation
of new keys.
Tries to register manager for manager . getKeyType () . If newKeyAllowed is true users can generate new keys with this manager using the Registry#newKey methods . If there is an existing key manager throws an exception if manager and the existing key manager aren ' t instances of the same class or if newKeyAllowed is true while the existing key manager could not create new keys . Otherwise registration succeeds . @throws GeneralSecurityException if there ' s an existing key manager is not an instance of the class of manager or the registration tries to re - enable the generation of new keys .
public static synchronized <P> void registerKeyManager(
      final KeyManager<P> manager, boolean newKeyAllowed) throws GeneralSecurityException {
    if (manager == null) {
      throw new IllegalArgumentException("key manager must be non-null.");
    }
    String typeUrl = manager.getKeyType();
    ensureKeyManagerInsertable(typeUrl, manager.getClass(), Collections.emptyMap(), newKeyAllowed);
    keyManagerMap.putIfAbsent(typeUrl, createContainerFor(manager));
    newKeyAllowedMap.put(typeUrl, Boolean.valueOf(newKeyAllowed));
  }
public static synchronized < P > void registerKeyManager ( final KeyManager < P > manager , boolean newKeyAllowed ) throws GeneralSecurityException { if ( manager == null ) { throw new IllegalArgumentException ( "key manager must be non-null." ) ; } String typeUrl = manager . getKeyType ( ) ; ensureKeyManagerInsertable ( typeUrl , manager . getClass ( ) , Collections . emptyMap ( ) , newKeyAllowed ) ; keyManagerMap . putIfAbsent ( typeUrl , createContainerFor ( manager ) ) ; newKeyAllowedMap . put ( typeUrl , Boolean . valueOf ( newKeyAllowed ) ) ; }
Tries to register {@code manager} for {@code manager.getKeyType()}.
Tries to register { @code manager } for { @code manager . getKeyType () } .
// Use an empty key format because old-style key managers don't export their key formats