List of usage examples for org.bouncycastle.openpgp PGPSecretKeyRingCollection encode
public void encode(OutputStream outStream) throws IOException
From source file:org.jivesoftware.smackx.ox.store.filebased.FileBasedOpenPgpKeyStore.java
License:Apache License
@Override public void writeSecretKeysOf(BareJid owner, PGPSecretKeyRingCollection secretKeys) throws IOException { File file = getSecretKeyRingPath(owner); if (secretKeys == null) { FileUtils.maybeDeleteFileOrThrow(file); return;/* ww w . j a v a 2s.c o m*/ } OutputStream outputStream = null; try { outputStream = FileUtils.prepareFileOutputStream(file); secretKeys.encode(outputStream); } finally { CloseableUtil.maybeClose(outputStream, LOGGER); } }