Package google.registry.rde
Class RydePgpSigningOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
google.registry.util.ImprovedOutputStream
google.registry.rde.RydePgpSigningOutputStream
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
OpenPGP detached signing service that wraps an
OutputStream
.
This is the outermost layer. It signs the resulting file without modifying its bytes,
instead generating an out-of-band .asc
signature file. This is basically a SHA-256
checksum of the deposit file that's signed with our RSA private key. This allows the people
who receive a deposit to check the signature against our public key so they can know the
data hasn't been forged.
-
Field Summary
Fields inherited from class java.io.FilterOutputStream
out
-
Constructor Summary
ConstructorDescriptionRydePgpSigningOutputStream
(OutputStream os, org.bouncycastle.openpgp.PGPKeyPair signingKey) Create a signer that wrapsos
and generates a detached signature usingsigningKey
. -
Method Summary
Methods inherited from class google.registry.util.ImprovedOutputStream
close, getBytesWritten, onClose, write
Methods inherited from class java.io.FilterOutputStream
flush
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
RydePgpSigningOutputStream
public RydePgpSigningOutputStream(@WillNotClose OutputStream os, org.bouncycastle.openpgp.PGPKeyPair signingKey) Create a signer that wrapsos
and generates a detached signature usingsigningKey
. After closing, you should callgetSignature()
to get the detached signature.- Parameters:
os
- is the upstreamOutputStream
which is not closed by this object- Throws:
RuntimeException
- to rethrowPGPException
-
-
Method Details
-
getSignature
Returns the byte contents for the detached.asc
signature file.- Throws:
IOException
org.bouncycastle.openpgp.PGPException
-
write
- Overrides:
write
in classImprovedOutputStream
- Throws:
IOException
- See Also:
-
write
- Overrides:
write
in classImprovedOutputStream
- Throws:
IOException
- See Also:
-