/** * @return a new {@link KeysetHandle} from a {@link Keyset} read with {@code reader}. * @throws GeneralSecurityException */ public static KeysetHandle read(KeysetReader reader) throws GeneralSecurityException, IOException { return KeysetHandle.fromKeyset(reader.read()); }
/** @return a {@link KeysetHandle} of the managed keyset */ @GuardedBy("this") public synchronized KeysetHandle getKeysetHandle() throws GeneralSecurityException { return KeysetHandle.fromKeyset(keysetBuilder.build()); }
/** * @return a new {@link KeysetHandle} from {@code serialized} that is a serialized {@link Keyset} * @throws GeneralSecurityException * @deprecated use {@link #read} instead */ @Deprecated public static final KeysetHandle parseFrom(final byte[] serialized) throws GeneralSecurityException { try { Keyset keyset = Keyset.parseFrom(serialized); return KeysetHandle.fromKeyset(keyset); } catch (InvalidProtocolBufferException e) { throw new GeneralSecurityException("invalid keyset"); } }
/** * @return a new keyset handle from {@code serialized} which is a serialized {@link Keyset}. * @throws GeneralSecurityException * @deprecated use {@link NoSecretKeysetHandle#read} instead */ @Deprecated public static final KeysetHandle parseFrom(final byte[] serialized) throws GeneralSecurityException { try { Keyset keyset = Keyset.parseFrom(serialized); validate(keyset); return KeysetHandle.fromKeyset(keyset); } catch (InvalidProtocolBufferException e) { throw new GeneralSecurityException("invalid keyset"); } }
/** * @return a new keyset handle from a keyset obtained from {@code reader}. * @throws GeneralSecurityException */ public static final KeysetHandle read(KeysetReader reader) throws GeneralSecurityException, IOException { Keyset keyset = reader.read(); validate(keyset); return KeysetHandle.fromKeyset(keyset); }