Skip to content

Commit

Permalink
Fix javadoc warnings.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 315516150
  • Loading branch information
thaidn authored and copybara-github committed Jun 9, 2020
1 parent d14244a commit a9dabb7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ final Class<PrimitiveT> getPrimitiveClass() {
* Constructs a new KeyTypeManager.
*
* <p>Takes an arbitrary number of {@link PrimitiveFactory} objects as input. These will be used
* and provided via {@link #createPrimitive} to the user.
* and provided via {@link #getPrimitive} to the user.
*
* @throws IllegalArgumentException if two of the passed in factories produce primitives of the
* same class.
Expand Down
31 changes: 16 additions & 15 deletions java_src/src/main/java/com/google/crypto/tink/Registry.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,21 @@
/**
* A global container of key managers and catalogues.
*
* <p>Registry maps catalogue names to instances of {@link Catalogue} and each supported key type to
* a corresponding {@link KeyManager} object, which "understands" the key type (i.e., the KeyManager
* can instantiate the primitive corresponding to given key, or can generate new keys of the
* supported key type). It holds also a {@link PrimitiveWrapper} for each supported primitive,
* so that it can wrap a set of primitives (corresponding to a keyset) into a single primitive.
* <p>Registry maps each supported key type to a corresponding {@link KeyManager} object, which
* "understands" the key type (i.e., the KeyManager can instantiate the primitive corresponding to
* given key, or can generate new keys of the supported key type). It holds also a {@link
* PrimitiveWrapper} for each supported primitive, so that it can wrap a set of primitives
* (corresponding to a keyset) into a single primitive.
*
* <p> Keeping KeyManagers for all primitives in a single Registry (rather than
* having a separate KeyManager per primitive) enables modular construction of compound primitives
* from "simple" ones, e.g., AES-CTR-HMAC AEAD encryption uses IND-CPA encryption and a MAC.
* <p>Keeping KeyManagers for all primitives in a single Registry (rather than having a separate
* KeyManager per primitive) enables modular construction of compound primitives from "simple" ones,
* e.g., AES-CTR-HMAC AEAD encryption uses IND-CPA encryption and a MAC.
*
* <p>Registry is initialized at startup, and is later used to instantiate primitives for given keys
* or keysets. Note that regular users will usually not work directly with Registry, but rather via
* {@link Config} and {@link KeysetHandle#getPrimitive()}-methods, which in the background register
* and query the Registry for specific KeyManagers and PrimitiveWrappers. Registry is public though,
* to enable configurations with custom catalogues, primitives or KeyManagers.
* {@link TinkConfig} and {@link KeysetHandle#getPrimitive(Class)}-methods, which in the background
* register and query the Registry for specific KeyManagers and PrimitiveWrappers. Registry is
* public though, to enable configurations with custom catalogues, primitives or KeyManagers.
*
* <p>To initialize the Registry with all key managers:
*
Expand All @@ -62,8 +62,7 @@
* AeadConfig.register();
* }</pre>
*
* <p>After the Registry has been initialized, one can use {@keysetHandle.getPrimitive} to get a
* primitive. For example, to obtain an {@link Aead} primitive:
* <p>After the Registry has been initialized, one can use get a primitive as follows:
*
* <pre>{@code
* KeysetHandle keysetHandle = ...;
Expand Down Expand Up @@ -758,8 +757,8 @@ public static synchronized MessageLite newKey(String typeUrl, MessageLite format
}

/**
* Method to derive a key, using the given {@param 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.
*
* <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
Expand Down Expand Up @@ -1051,4 +1050,6 @@ static MessageLite parseKeyData(KeyData keyData)
KeyManagerContainer container = getKeyManagerContainerOrThrow(keyData.getTypeUrl());
return container.parseKey(keyData.getValue());
}

private Registry() {}
}

0 comments on commit a9dabb7

Please sign in to comment.