View Javadoc

1   package com.atlassian.asap.core.keys;
2   
3   import com.atlassian.asap.api.exception.CannotRetrieveKeyException;
4   import com.atlassian.asap.core.validator.ValidatedKeyId;
5   
6   import java.security.Key;
7   
8   public interface KeyProvider<K extends Key> {
9       /**
10       * Provides a Key for a validated key identifier.
11       *
12       * @param keyId the validated keyId of interest which is safe from directory traversal
13       * @return the relevant key if found
14       * @throws CannotRetrieveKeyException if the key couldn't be retrieved or found.
15       */
16      K getKey(ValidatedKeyId keyId) throws CannotRetrieveKeyException;
17  }