commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject [PGP] API sketch
Date Wed, 18 May 2005 11:08:22 GMT
Sorry for keeping quiet after the first email, but I've been
even more busy than I expected.

So far I don't see any reason to require a JDK > 1.2.

Looking through the immediate needs for Ant and Maven, we'd need
something like

interface Foo {

    /** @param keyId may be null to specify the default key */
    void sign(InputStream data, OutputStream signedOutput,
              String keyId, KeyRing keyRing, boolean asciiArmor)
        throws PGPException;

    /** @param keyId may be null to specify the default key */
    void detachedSign(InputStream data, OutputStream signature,
                      String keyId, KeyRing keyRing, boolean asciiArmor)
        throws PGPException;

    SignatureStatus verifySignature(InputStream data, KeyRing keyRing)
        throws PGPException;

    SignatureStatus verifyDetachedSignature(InputStream data,
                                            InputStream signature,
                                            KeyRing keyRing)
        throws PGPException;
}

class KeyRing {
    InputSteam getStream();
    /** @return null for a public key ring. */
    char[] getPassPhrase();
}

PGPException would be a wrapper for the real exception an
implementation could throw (but I wouldn't want to depend on
commons-lang just for NestableException).

SignatureStatus an enum-like class with ValidSignature, UnknownKey and
InvalidSignature.  We may even include trust calculations here (if
supported), ValidTrustedSignature and ValidUntrustedSignature or
similar.

And finally

class FooFactory {
     static FooFactory getFactory() throws PGPException;
     Foo newFoo() throws PGPException;
}

Foo is a placeholder since (1) I can't come up with a good name right
now and (2) have a long track record of inventing bad names anyway.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message