/** * @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); }