@Test(expected = PgpGeneralException.class) public void testDecodeFromEmpty() throws Exception { UncachedKeyRing.decodeFromData(new byte[0]); }
public static UncachedKeyRing decodeFromData(byte[] data) throws PgpGeneralException, IOException { IteratorWithIOThrow<UncachedKeyRing> parsed = fromStream(new ByteArrayInputStream(data)); if ( ! parsed.hasNext()) { throw new PgpGeneralException("Object not recognized as PGPKeyRing!"); } UncachedKeyRing ring = parsed.next(); if (parsed.hasNext()) { throw new PgpGeneralException("Expected single keyring in stream, found at least two"); } return ring; }
UncachedKeyRing { public static UncachedKeyRing decodeFromData(byte[] data) throws PgpGeneralException, IOException { IteratorWithIOThrow<UncachedKeyRing> parsed = fromStream(new ByteArrayInputStream(data)); if ( ! parsed.hasNext()) { throw new PgpGeneralException("Object not recognized as PGPKeyRing!"); } UncachedKeyRing ring = parsed.next(); if (parsed.hasNext()) { throw new PgpGeneralException("Expected single keyring in stream, found at least two"); } return ring; } }
UncachedKeyRing { public static UncachedKeyRing decodeFromData(byte[] data) throws PgpGeneralException, IOException { IteratorWithIOThrow<UncachedKeyRing> parsed = fromStream(new ByteArrayInputStream(data)); if ( ! parsed.hasNext()) { throw new PgpGeneralException("Object not recognized as PGPKeyRing!"); } UncachedKeyRing ring = parsed.next(); if (parsed.hasNext()) { throw new PgpGeneralException("Expected single keyring in stream, found at least two"); } return ring; } UncachedKeyRing(PGPKeyRing ring); }
UncachedKeyRing { public static UncachedKeyRing decodeFromData(byte[] data) throws PgpGeneralException, IOException { IteratorWithIOThrow<UncachedKeyRing> parsed = fromStream(new ByteArrayInputStream(data)); if ( ! parsed.hasNext()) { throw new PgpGeneralException("Object not recognized as PGPKeyRing!"); } UncachedKeyRing ring = parsed.next(); if (parsed.hasNext()) { throw new PgpGeneralException("Expected single keyring in stream, found at least two"); } return ring; } UncachedKeyRing(PGPKeyRing ring); long getMasterKeyId(); long getCreationTime(); UncachedPublicKey getPublicKey(); UncachedPublicKey getPublicKey(long keyId); Iterator<UncachedPublicKey> getPublicKeys(); boolean isSecret(); byte[] getEncoded(); void encode(OutputStream out); byte[] getFingerprint(); int getVersion(); static UncachedKeyRing decodeFromData(byte[] data); boolean containsKeyWithAnyFingerprint(List<byte[]> expectedFingerprints); static IteratorWithIOThrow<UncachedKeyRing> fromStream(InputStream rawStream); void encodeArmored(OutputStream out, String version); @SuppressWarnings("ConstantConditions") CanonicalizedKeyRing canonicalize(OperationLog log, int indent); @SuppressWarnings("ConstantConditions") CanonicalizedKeyRing canonicalize(OperationLog log, int indent, boolean forExport); UncachedKeyRing merge(UncachedKeyRing other, OperationLog log, int indent); UncachedKeyRing extractPublicKeyRing(); @VisibleForTesting static UncachedKeyRing forTestingOnlyAddDummyLocalSignature(
            UncachedKeyRing uncachedKeyRing, String passphrase); }
UncachedKeyRing { public static UncachedKeyRing decodeFromData(byte[] data) throws PgpGeneralException, IOException { IteratorWithIOThrow<UncachedKeyRing> parsed = fromStream(new ByteArrayInputStream(data)); if ( ! parsed.hasNext()) { throw new PgpGeneralException("Object not recognized as PGPKeyRing!"); } UncachedKeyRing ring = parsed.next(); if (parsed.hasNext()) { throw new PgpGeneralException("Expected single keyring in stream, found at least two"); } return ring; } UncachedKeyRing(PGPKeyRing ring); long getMasterKeyId(); long getCreationTime(); UncachedPublicKey getPublicKey(); UncachedPublicKey getPublicKey(long keyId); Iterator<UncachedPublicKey> getPublicKeys(); boolean isSecret(); byte[] getEncoded(); void encode(OutputStream out); byte[] getFingerprint(); int getVersion(); static UncachedKeyRing decodeFromData(byte[] data); boolean containsKeyWithAnyFingerprint(List<byte[]> expectedFingerprints); static IteratorWithIOThrow<UncachedKeyRing> fromStream(InputStream rawStream); void encodeArmored(OutputStream out, String version); @SuppressWarnings("ConstantConditions") CanonicalizedKeyRing canonicalize(OperationLog log, int indent); @SuppressWarnings("ConstantConditions") CanonicalizedKeyRing canonicalize(OperationLog log, int indent, boolean forExport); UncachedKeyRing merge(UncachedKeyRing other, OperationLog log, int indent); UncachedKeyRing extractPublicKeyRing(); @VisibleForTesting static UncachedKeyRing forTestingOnlyAddDummyLocalSignature(
            UncachedKeyRing uncachedKeyRing, String passphrase);  }