Class KeyStore.Crypto

  • Enclosing class:
    KeyStore

    public static class KeyStore.Crypto
    extends java.lang.Object
    Represent a Crypto data in KeyStore It represents a 'keyring' in KeyStore Format V4 - If role-based Keyring : It has a List that has Crypto list. - If other type keyring : It has a List that has Crypto. It represents a 'crypto' in KeyStore Format V3
    • Constructor Summary

      Constructors 
      Constructor Description
      Crypto()
      Creates an Crypto instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<KeyStore.Crypto> createCrypto​(PrivateKey[] privateKeys, java.lang.String password, KeyStoreOption option)
      Creates Crypto instances with given params.
      static java.lang.String decryptCrypto​(KeyStore.Crypto crypto, java.lang.String password)
      Decrypts a keys in KeyStore
      java.lang.String getCipher()
      Getter function for cipher.
      KeyStore.CipherParams getCipherparams()
      Getter function for CipherParams.
      java.lang.String getCiphertext()
      Getter function for cipher text.
      java.lang.String getKdf()
      Getter function for kdf name.
      com.klaytn.caver.wallet.keyring.KeyStore.IKdfParams getKdfparams()
      Getter function for KdfParams.
      java.lang.String getMac()
      Getter function for mac.
      void setCipher​(java.lang.String cipher)
      Setter function for cipher.
      void setCipherparams​(KeyStore.CipherParams cipherparams)
      Setter function for CipherParams.
      void setCiphertext​(java.lang.String ciphertext)
      Setter function for cipher text
      void setKdf​(java.lang.String kdf)
      Setter function for kdf name.
      void setKdfparams​(com.klaytn.caver.wallet.keyring.KeyStore.IKdfParams kdfparams)
      Setter function for KdfParams.
      void setMac​(java.lang.String mac)
      Setter function for mac.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Crypto

        public Crypto()
        Creates an Crypto instance.
    • Method Detail

      • createCrypto

        public static java.util.List<KeyStore.Crypto> createCrypto​(PrivateKey[] privateKeys,
                                                                   java.lang.String password,
                                                                   KeyStoreOption option)
                                                            throws org.web3j.crypto.CipherException
        Creates Crypto instances with given params.
        Parameters:
        privateKeys - An array of PrivateKeys to be encrypted.
        password - The password to be used for encryption. The encrypted in KeyStore can be decrypted with this password.
        option - The options to use when encrypt a keys.
        Returns:
        List
        Throws:
        org.web3j.crypto.CipherException
      • decryptCrypto

        public static java.lang.String decryptCrypto​(KeyStore.Crypto crypto,
                                                     java.lang.String password)
                                              throws org.web3j.crypto.CipherException
        Decrypts a keys in KeyStore
        Parameters:
        crypto - Crypto instance
        password - The password to use for decryption.
        Returns:
        String
        Throws:
        org.web3j.crypto.CipherException
      • getCipher

        public java.lang.String getCipher()
        Getter function for cipher.
        Returns:
        String
      • setCipher

        public void setCipher​(java.lang.String cipher)
        Setter function for cipher.
        Parameters:
        cipher - cipher algorithm name.
      • getCiphertext

        public java.lang.String getCiphertext()
        Getter function for cipher text.
        Returns:
        String
      • setCiphertext

        public void setCiphertext​(java.lang.String ciphertext)
        Setter function for cipher text
        Parameters:
        ciphertext - encrypted key
      • getCipherparams

        public KeyStore.CipherParams getCipherparams()
        Getter function for CipherParams.
        Returns:
        KeyStore.CipherParams.
      • setCipherparams

        public void setCipherparams​(KeyStore.CipherParams cipherparams)
        Setter function for CipherParams.
        Parameters:
        cipherparams - KeyStore.CipherParams.
      • getKdf

        public java.lang.String getKdf()
        Getter function for kdf name.
        Returns:
        String
      • setKdf

        public void setKdf​(java.lang.String kdf)
        Setter function for kdf name.
        Parameters:
        kdf - kdf name.
      • getKdfparams

        public com.klaytn.caver.wallet.keyring.KeyStore.IKdfParams getKdfparams()
        Getter function for KdfParams.
        Returns:
        KeyStore.KdfParams
      • setKdfparams

        public void setKdfparams​(com.klaytn.caver.wallet.keyring.KeyStore.IKdfParams kdfparams)
        Setter function for KdfParams.
        Parameters:
        kdfparams - KeyStore.KdfParams.
      • getMac

        public java.lang.String getMac()
        Getter function for mac.
        Returns:
        String
      • setMac

        public void setMac​(java.lang.String mac)
        Setter function for mac.
        Parameters:
        mac - mac string.