@Test(expected = RuntimeException.class) public void testPublicExtractPublic() throws Exception { pubRing.extractPublicKeyRing(); }
public UncachedKeyRing extractPublicKeyRing() throws IOException { if(!isSecret()) { throw new RuntimeException("Tried to extract public keyring from non-secret keyring. " + "This is a programming error and should never happen!"); } Iterator<PGPPublicKey> it = mRing.getPublicKeys(); ByteArrayOutputStream stream = new ByteArrayOutputStream(2048); while (it.hasNext()) { stream.write(it.next().getEncoded()); } return new UncachedKeyRing( new PGPPublicKeyRing(stream.toByteArray(), new JcaKeyFingerprintCalculator())); }
UncachedKeyRing { public UncachedKeyRing extractPublicKeyRing() throws IOException { if(!isSecret()) { throw new RuntimeException("Tried to extract public keyring from non-secret keyring. " + "This is a programming error and should never happen!"); } Iterator<PGPPublicKey> it = mRing.getPublicKeys(); ByteArrayOutputStream stream = new ByteArrayOutputStream(2048); while (it.hasNext()) { stream.write(it.next().getEncoded()); } return new UncachedKeyRing( new PGPPublicKeyRing(stream.toByteArray(), new JcaKeyFingerprintCalculator())); } }
UncachedKeyRing { public UncachedKeyRing extractPublicKeyRing() throws IOException { if(!isSecret()) { throw new RuntimeException("Tried to extract public keyring from non-secret keyring. " + "This is a programming error and should never happen!"); } Iterator<PGPPublicKey> it = mRing.getPublicKeys(); ByteArrayOutputStream stream = new ByteArrayOutputStream(2048); while (it.hasNext()) { stream.write(it.next().getEncoded()); } return new UncachedKeyRing( new PGPPublicKeyRing(stream.toByteArray(), new JcaKeyFingerprintCalculator())); } UncachedKeyRing(PGPKeyRing ring); }
UncachedKeyRing { public UncachedKeyRing extractPublicKeyRing() throws IOException { if(!isSecret()) { throw new RuntimeException("Tried to extract public keyring from non-secret keyring. " + "This is a programming error and should never happen!"); } Iterator<PGPPublicKey> it = mRing.getPublicKeys(); ByteArrayOutputStream stream = new ByteArrayOutputStream(2048); while (it.hasNext()) { stream.write(it.next().getEncoded()); } return new UncachedKeyRing( new PGPPublicKeyRing(stream.toByteArray(), new JcaKeyFingerprintCalculator())); } 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 UncachedKeyRing extractPublicKeyRing() throws IOException { if(!isSecret()) { throw new RuntimeException("Tried to extract public keyring from non-secret keyring. " + "This is a programming error and should never happen!"); } Iterator<PGPPublicKey> it = mRing.getPublicKeys(); ByteArrayOutputStream stream = new ByteArrayOutputStream(2048); while (it.hasNext()) { stream.write(it.next().getEncoded()); } return new UncachedKeyRing( new PGPPublicKeyRing(stream.toByteArray(), new JcaKeyFingerprintCalculator())); } 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);  }