Class Config


  • public final class Config
    extends java.lang.Object
    Static methods for handling of Tink configurations.

    Configurations, i.e., a collection of key types and their corresponding key managers supported by a specific run-time environment enable control of Tink setup via JSON-formatted config files that determine which key types are supported, and provide a mechanism for deprecation of obsolete/outdated cryptographic schemes (see config.proto for more info).

    Usage

    
     RegistryConfig registryConfig = ...;
     Config.register(registryConfig);
     
    Since:
    1.0.0
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static com.google.crypto.tink.proto.KeyTypeEntry getTinkKeyTypeEntry​(java.lang.String catalogueName, java.lang.String primitiveName, java.lang.String keyProtoName, int keyManagerVersion, boolean newKeyAllowed)
      Returns a KeyTypeEntry for Tink key types with the specified properties.
      static void register​(com.google.crypto.tink.proto.RegistryConfig config)
      Tries to register key managers according to the specification in config.
      static void registerKeyType​(com.google.crypto.tink.proto.KeyTypeEntry entry)
      Tries to register a key manager according to the specification in entry.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getTinkKeyTypeEntry

        public static com.google.crypto.tink.proto.KeyTypeEntry getTinkKeyTypeEntry​(java.lang.String catalogueName,
                                                                                    java.lang.String primitiveName,
                                                                                    java.lang.String keyProtoName,
                                                                                    int keyManagerVersion,
                                                                                    boolean newKeyAllowed)
        Returns a KeyTypeEntry for Tink key types with the specified properties.
      • register

        public static void register​(com.google.crypto.tink.proto.RegistryConfig config)
                             throws java.security.GeneralSecurityException
        Tries to register key managers according to the specification in config.
        Throws:
        java.security.GeneralSecurityException - if cannot register this config with the Registry. This usually happens when either config contains any KeyTypeEntry that is already registered or the Registry cannot find any KeyManager or Catalogue that can handle the entry. In both cases the error message should show how to resolve it.
      • registerKeyType

        public static void registerKeyType​(com.google.crypto.tink.proto.KeyTypeEntry entry)
                                    throws java.security.GeneralSecurityException
        Tries to register a key manager according to the specification in entry.
        Throws:
        java.security.GeneralSecurityException - if cannot register this config with the Registry. This usually happens when entry is already registered or the Registry cannot find any KeyManager or Catalogue that can handle the entry. In both cases the error message should show how to resolve it.