- All Known Implementing Classes:
DirKeyRing
public interface KeyRing
A backend for storing and retrieving SigningPublicKeys to be used for verifying signatures.
Method Summary
Method Details
getKey
PublicKey getKey(String keyName, String scope, SigType type) throws GeneralSecurityException, IOException Get a key. Throws on all errors.- Parameters:
keyName- the algorithm the key belongs to, such as ElGamal or ECDSAscope- a domain identifier, indicating router update, reseed, etc.type- the signature type the key is stored for- Returns:
- null if none
- Throws:
GeneralSecurityException- if the stored key cannot be decodedIOException- if the backing store cannot be read
setKey
void setKey(String keyName, String scope, PublicKey key) throws GeneralSecurityException, IOException Store a key. Throws on all errors.- Parameters:
keyName- the algorithm the key belongs to, such as ElGamal or ECDSAscope- a domain identifier, indicating router update, reseed, etc.key- the key to persist in this scope- Throws:
GeneralSecurityException- if the key cannot be encodedIOException- if the backing store cannot be written