| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- declare class JSEncrypt{
- constructor(options?);
- /**
- * Method to set the rsa key parameter (one method is enough to set both the public
- * and the private key, since the private key contains the public key paramenters)
- * Log a warning if logs are enabled
- * @param {Object|string} key the pem encoded string or an object (with or without header/footer)
- * @public
- */
- setKey(key: string);
- /**
- * Proxy method for setKey, for api compatibility
- * @see setKey
- * @public
- */
- setPrivateKey(privkey: string);
- /**
- * Proxy method for setKey, for api compatibility
- * @see setKey
- * @public
- */
- setPublicKey(pubkey: string);
- /**
- * Proxy method for RSAKey object's decrypt, decrypt the string using the private
- * components of the rsa key object. Note that if the object was not set will be created
- * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
- * @param {string} string base64 encoded crypted string to decrypt
- * @return {string} the decrypted string
- * @public
- */
- decrypt(string): string|false;
- /**
- * Proxy method for RSAKey object's encrypt, encrypt the string using the public
- * components of the rsa key object. Note that if the object was not set will be created
- * on the fly (by the getKey method) using the parameters passed in the JSEncrypt constructor
- * @param {string} string the string to encrypt
- * @return {string} the encrypted string encoded in base64
- * @public
- */
- encrypt(string) :string|false;
- /**
- * Getter for the current JSEncryptRSAKey object. If it doesn't exists a new object
- * will be created and returned
- * @param {callback} [cb] the callback to be called if we want the key to be generated
- * in an async fashion
- * @returns {JSEncryptRSAKey} the JSEncryptRSAKey object
- * @public
- */
- getKey(cb);
- /**
- * Returns the pem encoded representation of the private key
- * If the key doesn't exists a new key will be created
- * @returns {string} pem encoded representation of the private key WITH header and footer
- * @public
- */
- getPrivateKey();
- /**
- * Returns the pem encoded representation of the private key
- * If the key doesn't exists a new key will be created
- * @returns {string} pem encoded representation of the private key WITHOUT header and footer
- * @public
- */
- getPrivateKeyB64();
- /**
- * Returns the pem encoded representation of the public key
- * If the key doesn't exists a new key will be created
- * @returns {string} pem encoded representation of the public key WITH header and footer
- * @public
- */
- getPublicKey();
- /**
- * Returns the pem encoded representation of the public key
- * If the key doesn't exists a new key will be created
- * @returns {string} pem encoded representation of the public key WITHOUT header and footer
- * @public
- */
- getPublicKeyB64();
- }
|