/** * Init AeadConfig in the Tink library. */ private AeadDemo() { try { AeadConfig.register(); } catch (GeneralSecurityException ex) { log.error("Failed to initialize Tink", ex); } }
/** * Init AeadConfig in the Tink library. */ private AeadWithSavedKeyDemo() { try { AeadConfig.register(); } catch (GeneralSecurityException ex) { log.error("Failed to initialize Tink", ex); } }
/** * Tries to register with the {@link Registry} all instances of {@link * com.google.crypto.tink.Catalogue} and {@link com.google.crypto.tink.KeyManager} needed to * handle Aead key types supported in Tink. * * <p>Because Aead key types depend on {@link com.google.crypto.tink.Mac} key types, this method * also registers all Mac catalogues and key managers. * * @deprecated use {@link #register} */ @Deprecated public static void init() throws GeneralSecurityException { register(); }
/** * Registers with the {@code Registry} all Aead key types released with the latest version of * Tink. * * <p>Deprecated-yet-still-supported key types are registered in so-called "no new key"-mode, * which allows for usage of existing keys forbids generation of new key material. * * @deprecated use {@link #register} */ @Deprecated public static void registerStandardKeyTypes() throws GeneralSecurityException { register(); } }
/** * Tries to register with the {@link Registry} all instances of {@link * com.google.crypto.tink.Catalogue} needed to handle HybridDecrypt and HybridEncrypt key types * supported in Tink. * * <p>Because HybridDecrypt and HybridEncrypt key types depend on {@link * com.google.crypto.tink.Aead} and {@link com.google.crypto.tink.Mac} key types, this method also * registers all Aead and Mac catalogues. * * @since 1.2.0 */ public static void register() throws GeneralSecurityException { // The order of these calls matters. AeadConfig.register(); // includes Mac Registry.addCatalogue(HYBRID_ENCRYPT_CATALOGUE_NAME, new HybridEncryptCatalogue()); Registry.addCatalogue(HYBRID_DECRYPT_CATALOGUE_NAME, new HybridDecryptCatalogue()); Config.register(LATEST); } }