Class ScriptingKeyStore


  • public class ScriptingKeyStore
    extends AbstractScriptingStore
    Wrapper over KeyStore for scripting.
    Since:
    8.4RC1
    Version:
    $Id: 188dae172639828869f089f9173d8f3632e394e3 $
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.xwiki.crypto.pkix.params.CertifiedKeyPair retrieve()
      Retrieve a private key from a given store that may contains only a single key.
      org.xwiki.crypto.pkix.params.CertifiedKeyPair retrieve​(String password)
      Retrieve the certified key pair from a given store that may contains only a single key and decrypt it using the given password.
      org.xwiki.crypto.pkix.params.CertifiedKeyPair retrieve​(org.xwiki.crypto.pkix.params.CertifiedPublicKey publicKey)
      Retrieve the certified key pair from a given store that match the given certificate.
      org.xwiki.crypto.pkix.params.CertifiedKeyPair retrieve​(org.xwiki.crypto.pkix.params.CertifiedPublicKey publicKey, String password)
      Retrieve the certified key pair from a given store that match the given certificate and decrypt it using the given password.
      void store​(org.xwiki.crypto.pkix.params.CertifiedKeyPair keyPair)
      Store a private key and its certificate into a given store.
      void store​(org.xwiki.crypto.pkix.params.CertifiedKeyPair keyPair, String password)
      Store a private key and its certificate into a given store, encrypting the key with a password.
    • Method Detail

      • store

        public void store​(org.xwiki.crypto.pkix.params.CertifiedKeyPair keyPair)
                   throws KeyStoreException,
                          AccessDeniedException
        Store a private key and its certificate into a given store. NOT VERY SECURE, since the key will be store AS IS without encryption.
        Parameters:
        keyPair - the key pair to be stored.
        Throws:
        KeyStoreException - on error.
        AccessDeniedException - if you do not have edit access rights to the store.
      • store

        public void store​(org.xwiki.crypto.pkix.params.CertifiedKeyPair keyPair,
                          String password)
                   throws KeyStoreException,
                          AccessDeniedException
        Store a private key and its certificate into a given store, encrypting the key with a password.
        Parameters:
        keyPair - the key pair to be stored.
        password - the password to encrypt the private key.
        Throws:
        KeyStoreException - on error.
        AccessDeniedException - if you do not have edit access rights to the store.
      • retrieve

        public org.xwiki.crypto.pkix.params.CertifiedKeyPair retrieve()
                                                               throws KeyStoreException,
                                                                      AccessDeniedException
        Retrieve a private key from a given store that may contains only a single key.
        Returns:
        the certified key pair, or null if none have been found.
        Throws:
        KeyStoreException - on error.
        AccessDeniedException - if you do not have edit access rights to the store.
      • retrieve

        public org.xwiki.crypto.pkix.params.CertifiedKeyPair retrieve​(String password)
                                                               throws KeyStoreException,
                                                                      AccessDeniedException
        Retrieve the certified key pair from a given store that may contains only a single key and decrypt it using the given password.
        Parameters:
        password - the password to decrypt the private key.
        Returns:
        the certified key pair, or null if none have been found.
        Throws:
        KeyStoreException - on error.
        AccessDeniedException - if you do not have edit access rights to the store.
      • retrieve

        public org.xwiki.crypto.pkix.params.CertifiedKeyPair retrieve​(org.xwiki.crypto.pkix.params.CertifiedPublicKey publicKey)
                                                               throws KeyStoreException,
                                                                      AccessDeniedException
        Retrieve the certified key pair from a given store that match the given certificate.
        Parameters:
        publicKey - for which the private key is requested.
        Returns:
        the certified key pair corresponding to the given certificate, or null if none have been found.
        Throws:
        KeyStoreException - on error.
        AccessDeniedException - if you do not have edit access rights to the store.
      • retrieve

        public org.xwiki.crypto.pkix.params.CertifiedKeyPair retrieve​(org.xwiki.crypto.pkix.params.CertifiedPublicKey publicKey,
                                                                      String password)
                                                               throws KeyStoreException,
                                                                      AccessDeniedException
        Retrieve the certified key pair from a given store that match the given certificate and decrypt it using the given password.
        Parameters:
        publicKey - for which the private key is requested.
        password - the password to decrypt the private key.
        Returns:
        the certified key pair corresponding to the given certificate, or null if none have been found.
        Throws:
        KeyStoreException - on error.
        AccessDeniedException - if you do not have edit access rights to the store.