Interface MutableKeyStorage

  • All Superinterfaces:
    KeyStorage

    public interface MutableKeyStorage
    extends KeyStorage
    A KeyStorage provider that provides the ability to store new keys at runtime.
    Author:
    Carl Harris
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void store​(java.lang.String id, java.security.Key key)
      Stores a key using the given identifier, replacing any existing key with the same identifier.
      void store​(java.lang.String id, KeyWithMetadata keyWithMetadata)
      Stores a key and associated metadata using the given identifier, replacing any existing key and metadata with the same identifier.
    • Method Detail

      • store

        void store​(java.lang.String id,
                   java.security.Key key)
            throws KeyWrapException,
                   KeyStorageException
        Stores a key using the given identifier, replacing any existing key with the same identifier.
        Parameters:
        id - identifier for the subject key
        key - the subject key
        Throws:
        KeyWrapException - if an error occurs in wrapping the key; e.g. one of the myriad checked exceptions thrown by the JCA API
        KeyStorageException - if the underlying storage mechanism cannot successfully write the wrapped key to persistent storage
      • store

        void store​(java.lang.String id,
                   KeyWithMetadata keyWithMetadata)
            throws KeyWrapException,
                   KeyStorageException
        Stores a key and associated metadata using the given identifier, replacing any existing key and metadata with the same identifier.
        Parameters:
        id - identifier for the subject key
        keyWithMetadata - the subject key and metadata
        Throws:
        KeyWrapException - if an error occurs in wrapping the key; e.g. one of the myriad checked exceptions thrown by the JCA API
        MetadataWrapException - if an error occurs in encoding the metadata
        KeyStorageException - if the underlying storage mechanism cannot successfully write the wrapped key to persistent storage