Interface KeyPairStorage


  • public interface KeyPairStorage
    A service that provides storage for key pairs.
    Author:
    Carl Harris
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CA_FILE_NAME
      Name of the file or file-like object used to store additional CA certificates
      static java.lang.String CERT_FILE_NAME
      Name of the file or file-like object used to store a certificate
      static java.lang.String KEY_FILE_NAME
      Name of the file or file-like object used to store a private key
    • Field Detail

      • KEY_FILE_NAME

        static final java.lang.String KEY_FILE_NAME
        Name of the file or file-like object used to store a private key
        See Also:
        Constant Field Values
      • CERT_FILE_NAME

        static final java.lang.String CERT_FILE_NAME
        Name of the file or file-like object used to store a certificate
        See Also:
        Constant Field Values
      • CA_FILE_NAME

        static final java.lang.String CA_FILE_NAME
        Name of the file or file-like object used to store additional CA certificates
        See Also:
        Constant Field Values
    • Method Detail

      • retrieveCertificates

        java.util.List<java.security.cert.X509Certificate> retrieveCertificates​(java.lang.String id)
                                                                         throws NoSuchKeyException,
                                                                                KeyStorageException
        Retrieves the certificates associated for a key pair.

        This method can be used in situations in which the private key is not needed or is not available.

        Parameters:
        id - identifier of the key pair whose certificates are to be retrieved
        Returns:
        certificate chain
        Throws:
        NoSuchKeyException - if there exists no key pair with the given ID
        KeyStorageException - if an unexpected error occurs in loading the key from storage