1 RSA
Class Ax.crypt.RSA
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.RSA.JSRSA
-
Ax.crypt.RSA.JSRSA( object kp )
- Parameters:
- kp -
Ax.crypt.RSA.JSRSA
-
Ax.crypt.RSA.JSRSA( object kp )
- Info:
-
Creates a new RSA instance with the specified key pair (public and private keys). - Parameters:
- kp - key pair with the public and private keys
Method Detail
Ax.crypt.RSA.decrypt
-
byte[] Ax.crypt.RSA.decrypt( string encrypted )
- Info:
-
Decrypts the given message. - Parameters:
- encrypted - a base64 encoded encrypted message
- Returns:
- byte[]
Ax.crypt.RSA.decrypt
-
byte[] Ax.crypt.RSA.decrypt( byte[] encrypted )
- Info:
-
Decrypts the given message. - Parameters:
- encrypted - a base64 encoded encrypted message
- Returns:
- byte[]
Ax.crypt.RSA.encrypt
-
byte[] Ax.crypt.RSA.encrypt( string message )
- Info:
-
Encrypts the give nmessage. - Parameters:
- message - the message to encrypt
- Returns:
- byte[]
Ax.crypt.RSA.encrypt
-
byte[] Ax.crypt.RSA.encrypt( byte[] message )
- Info:
-
Encrypts the give nmessage. - Parameters:
- message - the message to encrypt
- Returns:
- byte[]
Ax.crypt.RSA.toBase64
-
string Ax.crypt.RSA.toBase64( byte[] message )
- Info:
-
Encodes the message to base 64. - Parameters:
- message - the message to encode
- Returns:
- string
Ax.crypt.RSA.toPrivateKey
-
string Ax.crypt.RSA.toPrivateKey()
- Info:
-
Returns the private key. - Returns:
- string
Ax.crypt.RSA.toPublicKey
-
string Ax.crypt.RSA.toPublicKey()
- Info:
-
Returns the public key. - Returns:
- string
Ax.crypt.RSA.toString
-
string Ax.crypt.RSA.toString( byte[] message )
- Info:
-
Allows to convert a decrypted byte[] to a string - Parameters:
- message - message to convert
- Returns:
- string
2 DES
Class Ax.crypt.DES
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.DES.JSDES
-
Ax.crypt.DES.JSDES()
- Info:
-
Creates a DES instance.
Method Detail
Ax.crypt.DES.decrypt
-
string Ax.crypt.DES.decrypt( string password, byte[] message )
- Info:
-
Decrypts the encrypted message using the given password. - Parameters:
- password - the password used to decrypt the message
- message - the encrypted message to decrypt
- Returns:
- string
var des = new Ax.crypt.DES(); var password = "mypassword"; var base64_secret = "nhhOrwBInbGBVr5XvCHKng=="; var message_secret = des.decrypt(password, Ax.util.Base64.decode(base64_secret)); console.log(" secret ", message_secret)
Ax.crypt.DES.encrypt
-
byte[] Ax.crypt.DES.encrypt( string password, string message )
- Info:
-
Encrypts the message using the given password. DES Key only allows passwords 8 characters long. If you try to use a password longer than 8 chars, only first 8 bytes will be considered. If password is less than 8 bytes, password is filled automatically. - Parameters:
- password - the password used to decrypt the message
- message - the content to encrypt
- Returns:
- byte[]
var des = new Ax.crypt.DES(); var password = "mypassword"; var message_source = "Secret Message"; var message_secret_bytes = des.encrypt(password, message_source); console.log(" secret message (base64)", Ax.util.Base64.encode(message_secret_bytes))
Class Ax.crypt.TripleDES
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.TripleDES.JS3DES
-
Ax.crypt.TripleDES.JS3DES()
- Info:
-
Creates a DES instance. By default uses DESede/ECB/PKCS5Padding algorithm
Ax.crypt.TripleDES.JS3DES
-
Ax.crypt.TripleDES.JS3DES( string algorithm )
- Info:
-
Build a cipher with a custom algorithm - Parameters:
- algorithm -
Method Detail
Ax.crypt.TripleDES.decrypt
-
string Ax.crypt.TripleDES.decrypt( string password, byte[] message )
- Info:
-
Decrypts the encrypted message using the given password. - Parameters:
- password - the password used to decrypt the message
- message - the encrypted message to decrypt
- Returns:
- string
var des = new Ax.crypt.TripleDES(); var password = "mypassword"; var base64_secret = "yoPTzoj1UimiEEcadS6MNQ=="; var message_secret = des.decrypt(password, Ax.util.Base64.decode(base64_secret)); console.log(" secret ", message_secret)
Ax.crypt.TripleDES.decrypt
-
string Ax.crypt.TripleDES.decrypt( string password, byte[] message, byte[] initial_vector )
- Info:
-
Decrypts the encrypted message using the given password. - Parameters:
- password - the password used to decrypt the message
- message - the encrypted message to decrypt
- initial_vector -
- Returns:
- string
var des = new Ax.crypt.TripleDES(); var password = "mypassword"; var base64_secret = "yoPTzoj1UimiEEcadS6MNQ=="; var message_secret = des.decrypt(password, Ax.util.Base64.decode(base64_secret)); console.log(" secret ", message_secret)
Ax.crypt.TripleDES.encrypt
-
byte[] Ax.crypt.TripleDES.encrypt( string password, string message )
- Info:
-
Encrypts the message using the given password. DES Key only allows passwords 8 characters long. If you try to use a password longer than 8 chars, only first 8 bytes will be considered. If password is less than 8 bytes, password is filled automatically. - Parameters:
- password - the password used to decrypt the message
- message - the content to encrypt
- Returns:
- byte[]
var des = new Ax.crypt.TripleDES(); var password = "mypassword"; var message_source = "Secret Message"; var message_secret_bytes = des.encrypt(password, message_source); console.log(" secret message (base64)", Ax.util.Base64.encode(message_secret_bytes))
Ax.crypt.TripleDES.encrypt
-
byte[] Ax.crypt.TripleDES.encrypt( string password, string message, byte[] initial_vector )
- Parameters:
- password -
- message -
- initial_vector -
- Returns:
- byte[]
var des = new Ax.crypt.TripleDES(); var password = "mypassword"; var message_source = "Secret Message"; var message_secret_bytes = des.encrypt(password, message_source); console.log(" secret message (base64)", Ax.util.Base64.encode(message_secret_bytes))
3 AES
Class Ax.crypt.AES
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.AES.JSAES
-
Ax.crypt.AES.JSAES()
- Info:
-
Creates a new AES instance using "AES/CBC/PKCS7Padding" as the default cypher
Ax.crypt.AES.JSAES
-
Ax.crypt.AES.JSAES( string cypher )
- Info:
-
Creates a new AES instance with the given cypher. - Parameters:
- cypher - cypher to use
Method Detail
Ax.crypt.AES.decrypt
-
string Ax.crypt.AES.decrypt( string password, string secretbase64 )
- Info:
-
Decrypts the secret using the password. It is used for Password salt encryption. The following method does the same as JSPassword.decrypt. - Parameters:
- password - password that will be used to decrypt the secret message
- secretbase64 - secret message to decrypt in base 64 format
- Returns:
- string
Ax.crypt.AES.decrypt
-
byte[] Ax.crypt.AES.decrypt( string password, string initVector, object data )
- Info:
-
Decrypts the data with AES algorithm, using the given password and initialization vector. - Parameters:
- password - password for decryption specified in encryption, assuming it has the form of a hex number like: E4A38479A2349177EAE6038A018483318350E7F5430BDC8F82F1974715CB54E5
- initVector - initialization vector specified in encryption, assuming it has the form of a hex number like: f0af2f441d222f8a7df4b468d0784edb
- data - encrypted data
- Returns:
- byte[]
Ax.crypt.AES.decrypt
-
byte[] Ax.crypt.AES.decrypt( byte[] password, byte[] initVector, object data )
- Info:
-
Decrypts the data with AES algorithm, using the given password and initialization vector. - Parameters:
- password - password for decryption specified in encryption
- initVector - initialization vector specified in encryption
- data - encrypted data
- Returns:
- byte[]
Ax.crypt.AES.decrypt
-
byte[] Ax.crypt.AES.decrypt( string key, string salt, string initVector, object data )
- Info:
-
Decrypts the data with AES algorithm, using the given secret key and initialization vector. Decrypt method with "salt". Not using AESCipherPlusSalt. The salt parameter is included in the SecretKey. - Parameters:
- key - secret key for decryption specified in encryption, assuming it has the form of a hex number like: E4A38479A2349177EAE6038A018483318350E7F5430BDC8F82F1974715CB54E5
- salt - salt for encryption
- initVector - initialization vector specified in encryption, assuming it has the form of a hex number like: f0af2f441d222f8a7df4b468d0784edb
- data - encrypted data
- Returns:
- byte[]
Ax.crypt.AES.decrypt
-
byte[] Ax.crypt.AES.decrypt( string key, string salt, string initVector, smallint keyLength, object data )
- Info:
-
Decrypts the data with AES algorithm, using the given secret key and initialization vector. Decrypt method with "salt". Not using AESCipherPlusSalt. The salt parameter is included in the SecretKey. - Parameters:
- key - secret key for decryption specified in encryption, assuming it has the form of a hex number like: E4A38479A2349177EAE6038A018483318350E7F5430BDC8F82F1974715CB54E5
- salt - salt for encryption
- initVector - initialization vector specified in encryption, assuming it has the form of a hex number like: f0af2f441d222f8a7df4b468d0784edb
- keyLength - secret key length in bits (128, 192 o 256)
- data - encrypted data
- Returns:
- byte[]
Ax.crypt.AES.decrypt
-
byte[] Ax.crypt.AES.decrypt( string key, string salt, byte[] initVector, object data )
- Info:
-
Decrypts the data with AES algorithm, using the given secret key and initialization vector. Decrypt method with "salt". Not using AESCipherPlusSalt. The salt parameter is included in the SecretKey. - Parameters:
- key - secret key for decryption specified in encryption, assuming it has the form of a hex number like: E4A38479A2349177EAE6038A018483318350E7F5430BDC8F82F1974715CB54E5
- salt - salt for encryption
- initVector - initialization vector specified in encryption
- data - encrypted data
- Returns:
- byte[]
Ax.crypt.AES.decrypt
-
byte[] Ax.crypt.AES.decrypt( string key, string salt, byte[] initVector, smallint keyLength, object data )
- Info:
-
Decrypts the data with AES algorithm, using the given secret key and initialization vector. Decrypt method with "salt". Not using AESCipherPlusSalt. The salt parameter is included in the SecretKey. - Parameters:
- key - secret key for decryption specified in encryption, assuming it has the form of a hex number like: E4A38479A2349177EAE6038A018483318350E7F5430BDC8F82F1974715CB54E5
- salt - salt for encryption
- initVector - initialization vector specified in encryption
- keyLength - secret key length in bits (128, 192 o 256)
- data - encrypted data
- Returns:
- byte[]
Ax.crypt.AES.decrypt
-
byte[] Ax.crypt.AES.decrypt( object key, byte[] data )
- Info:
-
Decrypts the data with AES algorithm, using the given secret key. - Parameters:
- key - secret key for decryption specified in encryption
- data - encrypted data
- Returns:
- byte[]
Ax.crypt.AES.encrypt
-
string Ax.crypt.AES.encrypt( smallint keyLength, string password, string secret )
- Info:
-
Encrypts the secret using the password and using the specified keylength. It is used for Password salt encryption. The following method does the same as JSPassword.encrypt. - Parameters:
- keyLength - secret key length in bits (128, 192 o 256)
- password - password that will be used to decrypt the secret message
- secret - secret message to encrypt
- Returns:
- string
Ax.crypt.AES.encrypt
-
byte[] Ax.crypt.AES.encrypt( string password, string initVector, string data )
- Info:
-
Encrypts the data with AES algorithm, using the given password and initialization vector. - Parameters:
- password - password for decryption, assuming it has the form of a hex number like: E4A38479A2349177EAE6038A018483318350E7F5430BDC8F82F1974715CB54E5
- initVector - initialization vector, assuming it has the form of a hex number like: f0af2f441d222f8a7df4b468d0784edb
- data - data to encrypt
- Returns:
- byte[]
Ax.crypt.AES.encrypt
-
byte[] Ax.crypt.AES.encrypt( string password, string initVector, byte[] data )
- Info:
-
Encrypts the data with AES algorithm, using the given password and initialization vector. - Parameters:
- password - password for decryption, assuming it has the form of a hex number like: E4A38479A2349177EAE6038A018483318350E7F5430BDC8F82F1974715CB54E5
- initVector - initialization vector, assuming it has the form of a hex number like: f0af2f441d222f8a7df4b468d0784edb
- data - data to encrypt
- Returns:
- byte[]
Ax.crypt.AES.encrypt
-
byte[] Ax.crypt.AES.encrypt( byte[] password, byte[] initVector, byte[] data )
- Info:
-
Encrypts the data with AES algorithm, using the given password and initialization vector. - Parameters:
- password - password for decryption
- initVector - initialization vector
- data - data to encrypt
- Returns:
- byte[]
Ax.crypt.AES.encrypt
-
byte[] Ax.crypt.AES.encrypt( string key, string salt, string initVector, string data )
- Info:
-
Encrypts the data with AES algorithm, using the given secret key and initialization vector. Encrypt method with "salt". Not using AESCipherPlusSalt. The salt parameter is included in the SecretKey. - Parameters:
- key - secret key for decryption, assuming it has the form of a hex number like: E4A38479A2349177EAE6038A018483318350E7F5430BDC8F82F1974715CB54E5
- salt - salt for encryption
- initVector - initialization vector, assuming it has the form of a hex number like: f0af2f441d222f8a7df4b468d0784edb
- data - data to encrypt
- Returns:
- byte[]
Ax.crypt.AES.encrypt
-
byte[] Ax.crypt.AES.encrypt( string key, string salt, string initVector, smallint keyLength, string data )
- Info:
-
Encrypts the data with AES algorithm, using the given secret key and initialization vector. Encrypt method with "salt". Not using AESCipherPlusSalt. The salt parameter is included in the SecretKey. - Parameters:
- key - secret key for decryption, assuming it has the form of a hex number like: E4A38479A2349177EAE6038A018483318350E7F5430BDC8F82F1974715CB54E5
- salt - salt for encryption
- initVector - initialization vector, assuming it has the form of a hex number like: f0af2f441d222f8a7df4b468d0784edb
- keyLength - secret key length in bits (128, 192 o 256)
- data - data to encrypt
- Returns:
- byte[]
Ax.crypt.AES.encrypt
-
byte[] Ax.crypt.AES.encrypt( string key, string salt, byte[] initVector, string data )
- Info:
-
Encrypts the data with AES algorithm, using the given secret key and initialization vector. Encrypt method with "salt". Not using AESCipherPlusSalt. The salt parameter is included in the SecretKey. - Parameters:
- key - secret key for decryption, assuming it has the form of a hex number like: E4A38479A2349177EAE6038A018483318350E7F5430BDC8F82F1974715CB54E5
- salt - salt for encryption
- initVector - initialization vector
- data - data to encrypt
- Returns:
- byte[]
Ax.crypt.AES.encrypt
-
byte[] Ax.crypt.AES.encrypt( string key, string salt, byte[] initVector, smallint keyLength, string data )
- Info:
-
Encrypts the data with AES algorithm, using the given secret key and initialization vector. Encrypt method with "salt". Not using AESCipherPlusSalt. The salt parameter is included in the SecretKey. - Parameters:
- key - secret key for decryption, assuming it has the form of a hex number like: E4A38479A2349177EAE6038A018483318350E7F5430BDC8F82F1974715CB54E5
- salt - salt for encryption
- initVector - initialization vector
- keyLength - secret key length in bits (128, 192 o 256)
- data - data to encrypt
- Returns:
- byte[]
4 Digest
Class Ax.crypt.Digest
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.Digest.JSDigest
-
Ax.crypt.Digest.JSDigest( string algorithm )
- Info:
-
Creates a new digest instance with the specified algorithm. - Parameters:
- algorithm -
Method Detail
Ax.crypt.Digest.digest
-
string Ax.crypt.Digest.digest()
- Info:
-
Completes the hash computation and resets the digest. - Returns:
- string
Ax.crypt.Digest.reset
-
object Ax.crypt.Digest.reset()
- Info:
-
Resets the digest for further use. - Returns:
- object
Ax.crypt.Digest.update
-
object Ax.crypt.Digest.update( string data )
- Info:
-
Processes the given data and updates the digest. - Parameters:
- data - the data to be processed
- Returns:
- object
Ax.crypt.Digest.update
-
object Ax.crypt.Digest.update( object data )
- Info:
-
Processes the given data and updates the digest. - Parameters:
- data - the data to be processed
- Returns:
- object
Ax.crypt.Digest.update
-
object Ax.crypt.Digest.update( object irs )
- Info:
-
Updates the digest given a ResultSet. It's useful to have a hash on ResulSet data used in junit tests. - Parameters:
- irs -
- Returns:
- object
5 Obfuscate
Class Ax.crypt.Obfuscate
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.Obfuscate.JSObfuscate
-
Ax.crypt.Obfuscate.JSObfuscate()
Method Detail
Ax.crypt.Obfuscate.encode
-
string Ax.crypt.Obfuscate.encode( string data )
- Info:
-
Encode a password/text using the 'obfuscate' algorithm (reversible encryption). Example: let password = new Ax.crypt.Obfuscate().encode('Hello world!'); WARNING: reverse method (tag) should not be implemented to avoid users with "dbstudio" or shell permission decrypting other users passwords!!!! - Parameters:
- data - the data to be processed
- Returns:
- string
6 Hmac
Class Ax.crypt.Hmac
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.Hmac.JSHmac
-
Ax.crypt.Hmac.JSHmac()
- Info:
-
Returns a Mac object that implements the HmacSHA512 algorithm.
Ax.crypt.Hmac.JSHmac
-
Ax.crypt.Hmac.JSHmac( string algorithm )
- Info:
-
Returns a Mac object that implements the specified MAC algorithm. - Parameters:
- algorithm - The standard name of the requested MAC algorithm. See the Mac section in the <a href='https://docs.oracle.com/javase/9/docs/specs/security/standard-names.html'> Java Security Standard Algorithm Names Specification </a> for information about standard algorithm names
https://docs.oracle.com/javase/9/docs/specs/security/standard-names.htmlJava Security Standard Algorithm Names Specification
Method Detail
Ax.crypt.Hmac.calculateHMAC
-
byte[] Ax.crypt.Hmac.calculateHMAC( string key, string data )
- Info:
-
Calculate Hmac signature using key - Parameters:
- key -
- data -
- Returns:
- byte[]
Ax.crypt.Hmac.calculateHMAC
-
byte[] Ax.crypt.Hmac.calculateHMAC( byte[] key, string data )
- Info:
-
Calculate Hmac signature using key - Parameters:
- key -
- data -
- Returns:
- byte[]
Ax.crypt.Hmac.calculateHMAC
-
byte[] Ax.crypt.Hmac.calculateHMAC( string key, byte[] data )
- Info:
-
Calculate Hmac signature using key - Parameters:
- key -
- data -
- Returns:
- byte[]
Ax.crypt.Hmac.calculateHMAC
-
byte[] Ax.crypt.Hmac.calculateHMAC( byte[] key, byte[] data )
- Info:
-
Calculate Hmac signature using key - Parameters:
- key -
- data -
- Returns:
- byte[]
7 SMime
Class Ax.crypt.SMime
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.SMime.JSSMime
-
Ax.crypt.SMime.JSSMime()
- Info:
-
Creates a new SMime instance.
Ax.crypt.SMime.JSSMime
-
Ax.crypt.SMime.JSSMime( string mime )
- Info:
-
Creates a new SMime instance with the specified mime type. For example, application/pkcs7-mime. - Parameters:
- mime - mime type for encryption / signing
Method Detail
Ax.crypt.SMime.decrypt
-
byte[] Ax.crypt.SMime.decrypt( object privateKey, object encryptedData )
- Info:
-
Decrypts the encryptedData using the given privateKey. - Parameters:
- privateKey - private key used for decryption
- encryptedData - the encrypted data to decrypt
- Returns:
- byte[]
Ax.crypt.SMime.decrypt
-
byte[] Ax.crypt.SMime.decrypt( object privateKey, byte[] encryptedData )
- Info:
-
Decrypts the encryptedData using the given privateKey. - Parameters:
- privateKey - private key used for decryption
- encryptedData - the encrypted data to decrypt
- Returns:
- byte[]
Ax.crypt.SMime.encrypt
-
byte[] Ax.crypt.SMime.encrypt( object certificate, object encryptedData )
- Info:
-
Encrypts the data using the specified certificate. - Parameters:
- certificate - certificate for encryption
- encryptedData - data to encrypt
- Returns:
- byte[]
8 PKCS7
Class Ax.crypt.PKCS7
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.PKCS7.JSPKCS7
-
Ax.crypt.PKCS7.JSPKCS7()
- Info:
-
Creates a new PKCS7 instance.
Method Detail
Ax.crypt.PKCS7.decrypt
-
byte[] Ax.crypt.PKCS7.decrypt( object privateKey, object encryptedData )
- Info:
-
Decrypts the encryptedData with the given private key. - Parameters:
- privateKey - private key used for the decryption
- encryptedData - data to decrypt
- Returns:
- byte[]
Ax.crypt.PKCS7.encrypt
-
byte[] Ax.crypt.PKCS7.encrypt( string certificateText, object rawData )
- Info:
-
Encrypts the rawData with the given certificate. - Parameters:
- certificateText - certificate for encryption
- rawData - data to encrypt
- Returns:
- byte[]
Ax.crypt.PKCS7.encrypt
-
byte[] Ax.crypt.PKCS7.encrypt( string certificateText, object algorithm, object rawData )
- Info:
-
Encrypts the rawData with the given certificate. - Parameters:
- certificateText - certificate for encryption
- algorithm - algorithm used for encryption
- rawData - data to encrypt
- Returns:
- byte[]
Ax.crypt.PKCS7.encrypt
-
byte[] Ax.crypt.PKCS7.encrypt( string certificateText, string algorithmID, object rawData )
- Parameters:
- certificateText -
- algorithmID -
- rawData -
- Returns:
- byte[]
Ax.crypt.PKCS7.encrypt
-
byte[] Ax.crypt.PKCS7.encrypt( object certificate, object algorithm, object rawData )
- Info:
-
Encrypts the rawData with the given certificate. - Parameters:
- certificate - certificate for encryption
- algorithm - algorithm used for encryption
- rawData - data to encrypt
- Returns:
- byte[]
Ax.crypt.PKCS7.getData
-
byte[] Ax.crypt.PKCS7.getData( object rawData )
- Info:
-
Returns the given Object data as a byte array. - Parameters:
- rawData - Object to convert to byte array
- Returns:
- byte[]
Ax.crypt.PKCS7.sign
-
byte[] Ax.crypt.PKCS7.sign( string certificateText, object privateKey, object rawData )
- Info:
-
Signs the encrypted rawData using the specified certificate and the private key. - Parameters:
- certificateText - certificate to sign
- privateKey - private key used to sign
- rawData - encrypted data to sign
- Returns:
- byte[]
Ax.crypt.PKCS7.sign
-
byte[] Ax.crypt.PKCS7.sign( object certificate, object privateKey, object rawData )
- Info:
-
Signs the rawData (encrypted or not) using the specified certificate and the private key. - Parameters:
- certificate - certificate to sign
- privateKey - private key used to sign
- rawData - encrypted data to sign
- Returns:
- byte[]
Ax.crypt.PKCS7.verify
-
boolean Ax.crypt.PKCS7.verify( object signedData )
- Info:
-
Verifies the signed data to ensure it is safe. - Parameters:
- signedData - encrypted signed data
- Returns:
- boolean
9 PKCS8
Class Ax.crypt.PKCS8
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.PKCS8.JSPKCS8
-
Ax.crypt.PKCS8.JSPKCS8( string algorithm )
- Info:
-
Creates a new instance of PKCS8, with the specified algorithm - Parameters:
- algorithm - encoding algorithm to use
Method Detail
Ax.crypt.PKCS8.decode
-
byte[] Ax.crypt.PKCS8.decode( string text )
- Parameters:
- text -
- Returns:
- byte[]
Ax.crypt.PKCS8.encode
-
string Ax.crypt.PKCS8.encode( byte[] data )
- Info:
-
Encodes the provided data. - Parameters:
- data - data to encode
- Returns:
- string
Ax.crypt.PKCS8.sign
-
byte[] Ax.crypt.PKCS8.sign( string privateKey, string algorithm, object message )
- Info:
-
Signs the message with the specified algorithm and private key. - Parameters:
- privateKey - private key used to sign
- algorithm - algorithm used to sign
- message - message to sign
- Returns:
- byte[]
Ax.crypt.PKCS8.sign
-
byte[] Ax.crypt.PKCS8.sign( object privateKey, object message )
- Info:
-
Signs the message with the specified private key. - Parameters:
- privateKey - private key used to sign
- message - message to sign
- Returns:
- byte[]
Ax.crypt.PKCS8.verify
-
boolean Ax.crypt.PKCS8.verify( string key, string algorithm, object message, string signature )
- Info:
-
Verifies the signed data to ensure it is safe. - Parameters:
- key - public key used for verification
- algorithm - decoding algorithm
- message - signed message to verify
- signature - signature to verify
- Returns:
- boolean
Ax.crypt.PKCS8.verify
-
boolean Ax.crypt.PKCS8.verify( object key, object message, string signature )
- Info:
-
Verifies the signed data to ensure it is safe. - Parameters:
- key - public key used for verification
- message - signed message to verify
- signature - signature to verify
- Returns:
- boolean
Ax.crypt.PKCS8.verify
-
boolean Ax.crypt.PKCS8.verify( object key, object message, byte[] signature )
- Info:
-
Verifies the signed data to ensure it is safe. - Parameters:
- key - public key used for verification
- message - signed message to verify
- signature - signature to verify
- Returns:
- boolean
10 KeyPair
Class Ax.crypt.KeyPair
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.KeyPair.JSKeyPair
-
Ax.crypt.KeyPair.JSKeyPair( string algorithm, smallint size )
- Info:
-
Creates a key pair with the specified algorithm and size. - Parameters:
- algorithm - algorithm for key generation
- size - size of the key
new Ax.crypt.KeyPair("RSA", 2048);
Method Detail
Ax.crypt.KeyPair.getPrivateKey
-
byte[] Ax.crypt.KeyPair.getPrivateKey()
- Info:
-
Returns the private key component of this key pair as a byte array. - Returns:
- byte[]
Ax.crypt.KeyPair.getPrivateKeyAsPEM
-
string Ax.crypt.KeyPair.getPrivateKeyAsPEM()
- Info:
-
Returns the private key component of this key pair in PEM format as a string. - Returns:
- string
Ax.crypt.KeyPair.getPublicKey
-
byte[] Ax.crypt.KeyPair.getPublicKey()
- Info:
-
Returns the public key component of this key pair as a byte array. - Returns:
- byte[]
Ax.crypt.KeyPair.getPublicKeyAsPEM
-
string Ax.crypt.KeyPair.getPublicKeyAsPEM()
- Info:
-
Returns the public key component of this key pair in PEM format as a string. - Returns:
- string
Ax.crypt.KeyPair.getRawPrivateKey
-
object Ax.crypt.KeyPair.getRawPrivateKey()
- Info:
-
Returns the private key component of this key pair. - Returns:
- object
11 PGPKeyGen
Class Ax.crypt.PGPKeyGen
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.PGPKeyGen.JSPGPKeyGen
-
Ax.crypt.PGPKeyGen.JSPGPKeyGen( string identity, string password )
- Info:
-
Creates a new key generator, with the given identity and password. - Parameters:
- identity - identity associated with the keys
- password - password associated with the keys
Ax.crypt.PGPKeyGen.JSPGPKeyGen
-
Ax.crypt.PGPKeyGen.JSPGPKeyGen( string identity, string password, smallint secondsToExpire )
- Info:
-
Creates a new key generator, with the given identity, password and seconds to expire. - Parameters:
- identity - identity associated with the keys
- password - password associated with the keys
- secondsToExpire - seconds until the keys are invalid
Method Detail
Ax.crypt.PGPKeyGen.getPrivateKey
-
string Ax.crypt.PGPKeyGen.getPrivateKey()
- Info:
-
Returns the private key created by the generator. - Returns:
- string
Ax.crypt.PGPKeyGen.getPublicKey
-
string Ax.crypt.PGPKeyGen.getPublicKey()
- Info:
-
Returns the public key created by the generator. - Returns:
- string
12 PGPEncode
Class Ax.crypt.PGPEncode
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.PGPEncode.JSPGPEncode
-
Ax.crypt.PGPEncode.JSPGPEncode( string privateKey )
- Info:
-
Creates a new PGP encoder, using the specified private key. - Parameters:
- privateKey - the private key that the encoder will use
Ax.crypt.PGPEncode.JSPGPEncode
-
Ax.crypt.PGPEncode.JSPGPEncode( string privateKey, string identity )
- Info:
-
Creates a new PGP encoder, using the specified private key and the specified identity. - Parameters:
- privateKey - the private key that the encoder will use
- identity - the identity that the encoder will use
Method Detail
Ax.crypt.PGPEncode.encode
-
string Ax.crypt.PGPEncode.encode( string keyPassPhraseString, string message )
- Info:
-
Encodes the message using the keyPassPhraseString as password. - Parameters:
- keyPassPhraseString - passphrase used to encrypt the message
- message - mesage to encode
- Returns:
- string
13 PGPDecode
Class Ax.crypt.PGPDecode
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.PGPDecode.JSPGPDecode
-
Ax.crypt.PGPDecode.JSPGPDecode( string publicKey )
- Info:
-
Creates a new decoder with the specified public key. - Parameters:
- publicKey - the public key that the decoder will use
Method Detail
Ax.crypt.PGPDecode.decode
-
byte[] Ax.crypt.PGPDecode.decode( string message )
- Info:
-
Decodes the encoded message. - Parameters:
- message - message to decode
- Returns:
- byte[]
14 Password
Class Ax.crypt.Password
Constructor Summary
Constructor Detail
Ax.crypt.Password.JSPassword
-
Ax.crypt.Password.JSPassword( string plain )
- Info:
-
The constructor. Will be called as: let pass = Ax.crypt.Password("my_secret_passw"); - Parameters:
- plain - The plain password string
15 Whirlpool
Class Ax.crypt.Whirlpool
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.Whirlpool.JSWhirlpool
-
Ax.crypt.Whirlpool.JSWhirlpool()
- Info:
-
Creates a new Whirlpool instance
Method Detail
Ax.crypt.Whirlpool.add
-
object Ax.crypt.Whirlpool.add( string data )
- Info:
-
Adds the given data to the hash structure - Parameters:
- data - data to hash and encrypt
- Returns:
- object
Ax.crypt.Whirlpool.hash
-
string Ax.crypt.Whirlpool.hash()
- Info:
-
Processes the hashed data and returns the encrypted data. - Returns:
- string
16 XAdES
Class Ax.crypt.XAdES
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.XAdES.JSXAdES
-
Ax.crypt.XAdES.JSXAdES( object xml )
- Info:
-
Creates a new XAdES instance given an xml object - Parameters:
- xml - xml document to sign
Ax.crypt.XAdES.JSXAdES
-
Ax.crypt.XAdES.JSXAdES( object xml )
- Info:
-
Creates a new XAdES instance given an xml object - Parameters:
- xml - xml doument to sign
Method Detail
Ax.crypt.XAdES.getSignatureParameters
-
object Ax.crypt.XAdES.getSignatureParameters()
- Returns:
- object
Ax.crypt.XAdES.setBLevelParams
-
object Ax.crypt.XAdES.setBLevelParams( object consumer )
- Parameters:
- consumer - of BLevelParameters
- Returns:
- object
Ax.crypt.XAdES.setDigestAlgorithm
-
object Ax.crypt.XAdES.setDigestAlgorithm( string algorithm )
- Info:
-
Sets the digest algorithm. - Parameters:
- algorithm - digest algorithm to set
- Returns:
- object
Ax.crypt.XAdES.setDigestAlgorithm
-
object Ax.crypt.XAdES.setDigestAlgorithm( object algorithm )
- Info:
-
Sets the digest algorithm. DigestAlgorithms are specified in DigestAlgorithm class. - Parameters:
- algorithm - digest algorithm to set
- Returns:
- object
Ax.crypt.XAdES.setIgnoreMissingRevocationData
-
object Ax.crypt.XAdES.setIgnoreMissingRevocationData( boolean flag )
- Info:
-
Let users ignore an exception when checking the certificate for valid revocation data. Defaults to "false". Should be used when generating a signature of level "XAdES_BASELINE_LT" to avoid an error. We do not know why (because used certificates have revocation data, CRL lists) !?!?!?!?!? - Parameters:
- flag -
- Returns:
- object
Ax.crypt.XAdES.setSignatureLevel
-
object Ax.crypt.XAdES.setSignatureLevel( string level )
- Info:
-
Sets the signature level. - Parameters:
- level - signature level to set
- Returns:
- object
Ax.crypt.XAdES.setSignatureLevel
-
object Ax.crypt.XAdES.setSignatureLevel( object level )
- Info:
-
Sets the signature level. SignatureLevels are specified in subclasses. - Parameters:
- level - signature level to set
- Returns:
- object
Ax.crypt.XAdES.setSignaturePackaging
-
object Ax.crypt.XAdES.setSignaturePackaging( string packaging )
- Info:
-
Sets the signature packaging. - Parameters:
- packaging - signature packaginf to set
- Returns:
- object
Ax.crypt.XAdES.setSignaturePackaging
-
object Ax.crypt.XAdES.setSignaturePackaging( object packaging )
- Info:
-
Sets the signature packaging. SignaturePackagings are specified in subclasses. - Parameters:
- packaging - signature packaginf to set
- Returns:
- object
Ax.crypt.XAdES.setTspServer
-
object Ax.crypt.XAdES.setTspServer( string server )
- Info:
-
Sets the TSP server - Parameters:
- server - TSP server to set
- Returns:
- object
Ax.crypt.XAdES.sign
-
object Ax.crypt.XAdES.sign( object km, string keyPassword )
- Info:
-
Required for JavaScript call providing a JSKeyStoreManager and a plain password String. - Parameters:
- km -
- keyPassword -
- Returns:
- object
Ax.crypt.XAdES.sign
-
object Ax.crypt.XAdES.sign( object km, object managedKeyPassword )
- Info:
-
Required for JavaScript call providing a JSKeyStoreManager and a JSManagedPassword instance. - Parameters:
- km -
- managedKeyPassword -
- Returns:
- object
Ax.crypt.XAdES.sign
-
object Ax.crypt.XAdES.sign( object km, string alias, string keyPassword )
- Info:
-
Signs the object with the keys specified in km, with the given alias and plain password String. - Parameters:
- km - JSKeyStoreManager that contains the necessary keys
- alias - alias for signing
- keyPassword - password for signing
- Returns:
- object
Ax.crypt.XAdES.sign
-
object Ax.crypt.XAdES.sign( object km, string alias, object managedKeyPassword )
- Info:
-
Signs the object with the keys specified in km, with the given alias and a JSManagedPassword instance. - Parameters:
- km - JSKeyStoreManager that contains the necessary keys
- alias - alias for signing
- managedKeyPassword - managed-password instance for signing
- Returns:
- object
Ax.crypt.XAdES.verify
-
null Ax.crypt.XAdES.verify()
- Info:
-
Verifies the signed document to ensure it is safe. - Returns:
- null
Ax.crypt.XAdES.verify
-
null Ax.crypt.XAdES.verify( object signedDocument )
- Info:
-
Verifies the given signed document to ensure it is safe. - Parameters:
- signedDocument - signed document to verify
- Returns:
- null
17 CAdES
Class Ax.crypt.CAdES
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.CAdES.JSCAdES
-
Ax.crypt.CAdES.JSCAdES( object object )
- Info:
-
Creates a CAdES instance with the given object, and using the default signature level and signature packaging. - Parameters:
- object - object to sign
Method Detail
Ax.crypt.CAdES.getSignatureParameters
-
object Ax.crypt.CAdES.getSignatureParameters()
- Returns:
- object
Ax.crypt.CAdES.setBLevelParams
-
object Ax.crypt.CAdES.setBLevelParams( object consumer )
- Parameters:
- consumer - of BLevelParameters
- Returns:
- object
Ax.crypt.CAdES.setDigestAlgorithm
-
object Ax.crypt.CAdES.setDigestAlgorithm( string algorithm )
- Info:
-
Sets the digest algorithm. - Parameters:
- algorithm - digest algorithm to set
- Returns:
- object
Ax.crypt.CAdES.setDigestAlgorithm
-
object Ax.crypt.CAdES.setDigestAlgorithm( object algorithm )
- Info:
-
Sets the digest algorithm. DigestAlgorithms are specified in DigestAlgorithm class. - Parameters:
- algorithm - digest algorithm to set
- Returns:
- object
Ax.crypt.CAdES.setSignatureLevel
-
object Ax.crypt.CAdES.setSignatureLevel( string level )
- Info:
-
Sets the signature level. - Parameters:
- level - signature level to set
- Returns:
- object
Ax.crypt.CAdES.setSignatureLevel
-
object Ax.crypt.CAdES.setSignatureLevel( object level )
- Info:
-
Sets the signature level. SignatureLevels are specified in subclasses. - Parameters:
- level - signature level to set
- Returns:
- object
Ax.crypt.CAdES.setSignaturePackaging
-
object Ax.crypt.CAdES.setSignaturePackaging( string packaging )
- Info:
-
Sets the signature packaging. - Parameters:
- packaging - signature packaginf to set
- Returns:
- object
Ax.crypt.CAdES.setSignaturePackaging
-
object Ax.crypt.CAdES.setSignaturePackaging( object packaging )
- Info:
-
Sets the signature packaging. SignaturePackagings are specified in subclasses. - Parameters:
- packaging - signature packaginf to set
- Returns:
- object
Ax.crypt.CAdES.setTspServer
-
object Ax.crypt.CAdES.setTspServer( string server )
- Info:
-
Sets the TSP server - Parameters:
- server - TSP server to set
- Returns:
- object
Ax.crypt.CAdES.sign
-
object Ax.crypt.CAdES.sign( object km, string keyPassword )
- Info:
-
Required for JavaScript call providing a JSKeyStoreManager and a plain password String. - Parameters:
- km -
- keyPassword -
- Returns:
- object
Ax.crypt.CAdES.sign
-
object Ax.crypt.CAdES.sign( object km, object managedKeyPassword )
- Info:
-
Required for JavaScript call providing a JSKeyStoreManager and a JSManagedPassword instance. - Parameters:
- km -
- managedKeyPassword -
- Returns:
- object
Ax.crypt.CAdES.sign
-
object Ax.crypt.CAdES.sign( object km, string alias, string keyPassword )
- Info:
-
Signs the object with the keys specified in km, with the given alias and plain password String. - Parameters:
- km - JSKeyStoreManager that contains the necessary keys
- alias - alias for signing
- keyPassword - password for signing
- Returns:
- object
Ax.crypt.CAdES.sign
-
object Ax.crypt.CAdES.sign( object km, string alias, object managedKeyPassword )
- Info:
-
Signs the object with the keys specified in km, with the given alias and a JSManagedPassword instance. - Parameters:
- km - JSKeyStoreManager that contains the necessary keys
- alias - alias for signing
- managedKeyPassword - managed-password instance for signing
- Returns:
- object
18 PAdES
Class Ax.crypt.PAdES
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.PAdES.JSPAdES
-
Ax.crypt.PAdES.JSPAdES( object object )
- Info:
-
Creates a new PAdES instance with the given object to encrypt. - Parameters:
- object -
Method Detail
Ax.crypt.PAdES.getSignatureParameters
-
object Ax.crypt.PAdES.getSignatureParameters()
- Returns:
- object
Ax.crypt.PAdES.getSignatureParameters
-
object Ax.crypt.PAdES.getSignatureParameters()
- Returns:
- object
Ax.crypt.PAdES.setBLevelParams
-
object Ax.crypt.PAdES.setBLevelParams( object consumer )
- Parameters:
- consumer - of BLevelParameters
- Returns:
- object
Ax.crypt.PAdES.setContactInfo
-
object Ax.crypt.PAdES.setContactInfo( string contactInfo )
- Info:
-
Set signer contact info - Parameters:
- contactInfo - contact info of signer
- Returns:
- object
Ax.crypt.PAdES.setDigestAlgorithm
-
object Ax.crypt.PAdES.setDigestAlgorithm( string algorithm )
- Info:
-
Sets the digest algorithm. - Parameters:
- algorithm - digest algorithm to set
- Returns:
- object
Ax.crypt.PAdES.setDigestAlgorithm
-
object Ax.crypt.PAdES.setDigestAlgorithm( object algorithm )
- Info:
-
Sets the digest algorithm. DigestAlgorithms are specified in DigestAlgorithm class. - Parameters:
- algorithm - digest algorithm to set
- Returns:
- object
Ax.crypt.PAdES.setReason
-
object Ax.crypt.PAdES.setReason( string reason )
- Info:
-
Set signer reason. - Parameters:
- reason - signer reason
- Returns:
- object
Ax.crypt.PAdES.setSignatureImageParameters
-
object Ax.crypt.PAdES.setSignatureImageParameters( object configurator )
- Info:
-
Sets the signature image parameters, the parameters for a visible signature creation. - Parameters:
- configurator - Consumer that sets the image parameters
- Returns:
- object
Ax.crypt.PAdES.setSignatureLevel
-
object Ax.crypt.PAdES.setSignatureLevel( string level )
- Info:
-
Sets the signature level. - Parameters:
- level - signature level to set
- Returns:
- object
Ax.crypt.PAdES.setSignatureLevel
-
object Ax.crypt.PAdES.setSignatureLevel( object level )
- Info:
-
Sets the signature level. SignatureLevels are specified in subclasses. - Parameters:
- level - signature level to set
- Returns:
- object
Ax.crypt.PAdES.setSignatureName
-
object Ax.crypt.PAdES.setSignatureName( string signatureName )
- Info:
-
Set signature name. - Parameters:
- signatureName - signature name
- Returns:
- object
Ax.crypt.PAdES.setSignaturePackaging
-
object Ax.crypt.PAdES.setSignaturePackaging( string packaging )
- Info:
-
Sets the signature packaging. - Parameters:
- packaging - signature packaginf to set
- Returns:
- object
Ax.crypt.PAdES.setSignaturePackaging
-
object Ax.crypt.PAdES.setSignaturePackaging( object packaging )
- Info:
-
Sets the signature packaging. SignaturePackagings are specified in subclasses. - Parameters:
- packaging - signature packaginf to set
- Returns:
- object
Ax.crypt.PAdES.setTspServer
-
object Ax.crypt.PAdES.setTspServer( string server )
- Info:
-
Sets the TSP server - Parameters:
- server - TSP server to set
- Returns:
- object
Ax.crypt.PAdES.sign
-
object Ax.crypt.PAdES.sign( object km, string keyPassword )
- Info:
-
Required for JavaScript call providing a JSKeyStoreManager and a plain password String. - Parameters:
- km -
- keyPassword -
- Returns:
- object
Ax.crypt.PAdES.sign
-
object Ax.crypt.PAdES.sign( object km, object managedKeyPassword )
- Info:
-
Required for JavaScript call providing a JSKeyStoreManager and a JSManagedPassword instance. - Parameters:
- km -
- managedKeyPassword -
- Returns:
- object
Ax.crypt.PAdES.sign
-
object Ax.crypt.PAdES.sign( object km, string alias, string keyPassword )
- Info:
-
Signs the object with the keys specified in km, with the given alias and plain password String. - Parameters:
- km - JSKeyStoreManager that contains the necessary keys
- alias - alias for signing
- keyPassword - password for signing
- Returns:
- object
Ax.crypt.PAdES.sign
-
object Ax.crypt.PAdES.sign( object km, string alias, object managedKeyPassword )
- Info:
-
Signs the object with the keys specified in km, with the given alias and a JSManagedPassword instance. - Parameters:
- km - JSKeyStoreManager that contains the necessary keys
- alias - alias for signing
- managedKeyPassword - managed-password instance for signing
- Returns:
- object
19 XMLDSig
Class Ax.crypt.XMLDSig
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.XMLDSig.JSXMLDSig
-
Ax.crypt.XMLDSig.JSXMLDSig( object object )
- Info:
-
Creates an XMLDSig instance with the given xml document. - Parameters:
- object - xml document to sign
Ax.crypt.XMLDSig.JSXMLDSig
-
Ax.crypt.XMLDSig.JSXMLDSig( object object )
- Info:
-
Creates an XMLDSig instance with the given xml document. - Parameters:
- object - xml document to sign
Method Detail
Ax.crypt.XMLDSig.getCanonicalizationMethod
-
string Ax.crypt.XMLDSig.getCanonicalizationMethod()
- Info:
-
Returns the canonicalization method. - Returns:
- string
Ax.crypt.XMLDSig.getDigestMethod
-
string Ax.crypt.XMLDSig.getDigestMethod()
- Info:
-
Returns the digest method used. - Returns:
- string
Ax.crypt.XMLDSig.getSignatureMethod
-
string Ax.crypt.XMLDSig.getSignatureMethod()
- Info:
-
Returns the signature method currently set. - Returns:
- string
Ax.crypt.XMLDSig.isEnveloped
-
boolean Ax.crypt.XMLDSig.isEnveloped()
- Info:
-
Returns if the xml document is enveloped, that is, the root node is signed. If it s not enveloped it means it is detached, so a selected node is signed. - Returns:
- boolean
Ax.crypt.XMLDSig.setCanonicalizationMethod
-
null Ax.crypt.XMLDSig.setCanonicalizationMethod( string method )
- Info:
-
Sets the canonicalization method: ENVELOPED, EXCLUSIVE, EXCLUSIVE_WITH_COMMENTS, INCLUSIVE, INCLUSIVE_WITH_COMMENTS, BASE64, XPATH, XPATH2. Default is ENVELOPED. - Parameters:
- method - the canonicalization method to set
- Returns:
- null
Ax.crypt.XMLDSig.setDetachedNSElement
-
object Ax.crypt.XMLDSig.setDetachedNSElement( string detachedNS, string refId )
- Info:
-
Selects the detached element to sign. - Parameters:
- detachedNS - namespace of the element to sign
- refId - tag of the element to sign.
- Returns:
- object
Ax.crypt.XMLDSig.setDigestMethod
-
object Ax.crypt.XMLDSig.setDigestMethod( string method )
- Info:
-
Set the digest method: SHA1, SHA224, SHA256, SHA384, SHA384, SHA512, RIPEMD160, SHA3_224, SHA3_256, SHA3_384, SHA3_512. Default is SHA256. - Parameters:
- method - the digest method to use
- Returns:
- object
Ax.crypt.XMLDSig.setNamespacePrefix
-
object Ax.crypt.XMLDSig.setNamespacePrefix( string prefix )
- Info:
-
This method allows to define the name of namespace for signature tag generated by XMLDsig. - Parameters:
- prefix -
- Returns:
- object
Ax.crypt.XMLDSig.setSignatureMethod
-
object Ax.crypt.XMLDSig.setSignatureMethod( string method )
- Info:
-
Set the digest method: DSA_SHA1, DSA_SHA256, ECDSA_SHA1, ECDSA_SHA224, ECDSA_SHA256, ECDSA_SHA384, ECDSA_SHA512, HMAC_SHA1, HMAC_SHA224, HMAC_SHA256, HMAC_SHA384, HMAC_SHA512, RSA_SHA1, RSA_SHA224, RSA_SHA256, RSA_SHA384, RSA_SHA512, SHA1_RSA_MGF1, SHA224_RSA_MGF1, SHA256_RSA_MGF1, SHA384_RSA_MGF1, SHA512_RSA_MGF1. Default is SHA256. - Parameters:
- method - the signature method to use
- Returns:
- object
Ax.crypt.XMLDSig.sign
-
string Ax.crypt.XMLDSig.sign( object km, string keyPassword )
- Info:
-
Signs the document, using the specified key and certificate in the JSKeyStoreManager, and password. - Parameters:
- km - JSKeyStoreManager containing the encryption key and certificate
- keyPassword - password to get the key
- Returns:
- string
Ax.crypt.XMLDSig.sign
-
string Ax.crypt.XMLDSig.sign( object km, string alias, string keyPassword )
- Info:
-
Signs the document, using the specified key and certificate in the JSKeyStoreManager, alias and password. - Parameters:
- km - JSKeyStoreManager containing the encryption key and certificate
- alias - alias to get the key and certificate
- keyPassword - password to get the key
- Returns:
- string
Ax.crypt.XMLDSig.sign
-
string Ax.crypt.XMLDSig.sign( object ks, string alias, string keyPassword )
- Info:
-
Signs the document, using the specified key and certificate in the KeyStore, alias and password. - Parameters:
- ks -
- alias - alias to get the key and certificate
- keyPassword - password to get the key
- Returns:
- string
20 WSSecurity
Class Ax.crypt.WSSecurity
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.WSSecurity.JSWSSecurity
-
Ax.crypt.WSSecurity.JSWSSecurity( object root )
- Info:
-
Creates a new WSSSecurity instance with the given XML document. - Parameters:
- root - XML document to sign
Ax.crypt.WSSecurity.JSWSSecurity
-
Ax.crypt.WSSecurity.JSWSSecurity( object root )
- Info:
-
Creates a new WSSSecurity instance with the given XML document. - Parameters:
- root - XML document to sign
Method Detail
Ax.crypt.WSSecurity.getCanonicalizationMethod
-
object Ax.crypt.WSSecurity.getCanonicalizationMethod()
- Info:
-
Returns the canonicalization method. - Returns:
- object
Ax.crypt.WSSecurity.getDefaultNamespacePrefix
-
object Ax.crypt.WSSecurity.getDefaultNamespacePrefix()
- Returns:
- object
Ax.crypt.WSSecurity.getDefaultNamespacePrefix
-
object Ax.crypt.WSSecurity.getDefaultNamespacePrefix( string prefix )
- Parameters:
- prefix -
- Returns:
- object
Ax.crypt.WSSecurity.getDigestMethod
-
object Ax.crypt.WSSecurity.getDigestMethod()
- Info:
-
Returns the digest method used. - Returns:
- object
Ax.crypt.WSSecurity.getSignatureMethod
-
object Ax.crypt.WSSecurity.getSignatureMethod()
- Info:
-
Returns the signature method currently set. - Returns:
- object
Ax.crypt.WSSecurity.setCanonicalizationMethod
-
null Ax.crypt.WSSecurity.setCanonicalizationMethod( object method )
- Info:
-
Sets the canonicalization method: ENVELOPED, EXCLUSIVE, EXCLUSIVE_WITH_COMMENTS, INCLUSIVE, INCLUSIVE_WITH_COMMENTS, BASE64, XPATH, XPATH2. Default is ENVELOPED. - Parameters:
- method - the canonicalization method to set
- Returns:
- null
Ax.crypt.WSSecurity.setDigestMethod
-
object Ax.crypt.WSSecurity.setDigestMethod( object method )
- Info:
-
Set the digest method: SHA1, SHA224, SHA256, SHA384, SHA384, SHA512, RIPEMD160, SHA3_224, SHA3_256, SHA3_384, SHA3_512. Default is SHA256. - Parameters:
- method - the digest method to use
- Returns:
- object
Ax.crypt.WSSecurity.setExpires
-
object Ax.crypt.WSSecurity.setExpires( date t )
- Info:
-
Sets the expiration date of the signature validity. - Parameters:
- t - expiratnon date
- Returns:
- object
Ax.crypt.WSSecurity.setExpires
-
object Ax.crypt.WSSecurity.setExpires( long seconds )
- Info:
-
Sets the expiration time of the signature validity. - Parameters:
- seconds - the number of seconds to expire
- Returns:
- object
Ax.crypt.WSSecurity.setSignatureMethod
-
object Ax.crypt.WSSecurity.setSignatureMethod( object method )
- Info:
-
Set the digest method: DSA_SHA1, DSA_SHA256, ECDSA_SHA1, ECDSA_SHA224, ECDSA_SHA256, ECDSA_SHA384, ECDSA_SHA512, HMAC_SHA1, HMAC_SHA224, HMAC_SHA256, HMAC_SHA384, HMAC_SHA512, RSA_SHA1, RSA_SHA224, RSA_SHA256, RSA_SHA384, RSA_SHA512, SHA1_RSA_MGF1, SHA224_RSA_MGF1, SHA256_RSA_MGF1, SHA384_RSA_MGF1, SHA512_RSA_MGF1. Default is SHA256. - Parameters:
- method - the signature method to use
- Returns:
- object
Ax.crypt.WSSecurity.sign
-
string Ax.crypt.WSSecurity.sign( object km, string keyPassword )
- Info:
-
Signs the document, using the specified key and certificate in the JSKeyStoreManager, and password. - Parameters:
- km - JSKeyStoreManager containing the key and certificate
- keyPassword - password to get the key
- Returns:
- string
Ax.crypt.WSSecurity.sign
-
string Ax.crypt.WSSecurity.sign( object km, string alias, string keyPassword )
- Info:
-
Signs the document, using the specified key and certificate in the JSKeyStoreManager, alias and password. - Parameters:
- km - JSKeyStoreManager containing the key and certificate
- alias - alias to get the key and certificate
- keyPassword -
- Returns:
- string
Ax.crypt.WSSecurity.sign
-
string Ax.crypt.WSSecurity.sign( object ks, string alias, string keyPassword )
- Info:
-
Signs the document, using the specified key and certificate in the KeyStore, alias and password. - Parameters:
- ks - KeyStore containing the key and certificate
- alias - alias to get the key and certificate
- keyPassword - password to get the key
- Returns:
- string
21 JWT Builder
Class Ax.crypt.jwt.Builder
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.jwt.Builder.JSWebTokenBuilder
-
Ax.crypt.jwt.Builder.JSWebTokenBuilder()
Method Detail
Ax.crypt.jwt.Builder.addClaim
-
object Ax.crypt.jwt.Builder.addClaim( string key, string value )
- Info:
-
Add String claim - Parameters:
- key -
- value -
- Returns:
- object
Ax.crypt.jwt.Builder.addClaim
-
object Ax.crypt.jwt.Builder.addClaim( string key, object value )
- Info:
-
Add numeric claim - Parameters:
- key -
- value -
- Returns:
- object
Ax.crypt.jwt.Builder.addClaim
-
object Ax.crypt.jwt.Builder.addClaim( string key, object value )
- Info:
-
Add boolean claim - Parameters:
- key -
- value -
- Returns:
- object
Ax.crypt.jwt.Builder.addUser
-
object Ax.crypt.jwt.Builder.addUser( string user )
- Parameters:
- user -
- Returns:
- object
Ax.crypt.jwt.Builder.build
-
string Ax.crypt.jwt.Builder.build()
- Info:
-
build - Returns:
- string
Ax.crypt.jwt.Builder.setAudience
-
object Ax.crypt.jwt.Builder.setAudience( string aud )
- Info:
-
Set audience - Parameters:
- aud -
- Returns:
- object
Ax.crypt.jwt.Builder.setExpiration
-
object Ax.crypt.jwt.Builder.setExpiration( object exp )
- Info:
-
Set expiration. Must be convertible to a java.util.Date: That is: A JS native Date, A Ax.util.Date/ Ax.sql.Date A long representing millis since epoch - Parameters:
- exp -
- Returns:
- object
Ax.crypt.jwt.Builder.setIssuedAt
-
object Ax.crypt.jwt.Builder.setIssuedAt( date iat )
- Parameters:
- iat -
- Returns:
- object
Ax.crypt.jwt.Builder.setIssuer
-
object Ax.crypt.jwt.Builder.setIssuer( string iss )
- Info:
-
Set issues claim - Parameters:
- iss -
- Returns:
- object
Ax.crypt.jwt.Builder.setNotBefore
-
object Ax.crypt.jwt.Builder.setNotBefore( date nbf )
- Parameters:
- nbf -
- Returns:
- object
Ax.crypt.jwt.Builder.setSubject
-
object Ax.crypt.jwt.Builder.setSubject( string sub )
- Info:
-
Set subject claim - Parameters:
- sub -
- Returns:
- object
Ax.crypt.jwt.Builder.setUser
-
object Ax.crypt.jwt.Builder.setUser( string user )
- Info:
-
Set user claim - Parameters:
- user -
- Returns:
- object
Ax.crypt.jwt.Builder.signWith
-
object Ax.crypt.jwt.Builder.signWith( object alg, object key )
- Info:
-
Sign with key - Parameters:
- alg -
- key -
- Returns:
- object
Ax.crypt.jwt.Builder.signWith
-
object Ax.crypt.jwt.Builder.signWith( object alg, byte[] secretKeyBytes )
- Info:
-
Sign with scret key bytes - Parameters:
- alg -
- secretKeyBytes -
- Returns:
- object
Ax.crypt.jwt.Builder.signWith
-
object Ax.crypt.jwt.Builder.signWith( object alg, string plainSecretKey )
- Info:
-
Sign with plain secreat key - Parameters:
- alg -
- plainSecretKey -
- Returns:
- object
22 JWT Parser
Class Ax.crypt.jwt.Parser
Constructor Summary
Method Summary
Constructor Detail
Ax.crypt.jwt.Parser.JSWebTokenParser
-
Ax.crypt.jwt.Parser.JSWebTokenParser()
Method Detail
Ax.crypt.jwt.Parser.parse
-
object Ax.crypt.jwt.Parser.parse( string jwt )
- Parameters:
- jwt -
- Returns:
- object
Ax.crypt.jwt.Parser.setSigningKey
-
object Ax.crypt.jwt.Parser.setSigningKey( byte[] key )
- Parameters:
- key -
- Returns:
- object
Ax.crypt.jwt.Parser.setSigningKey
-
object Ax.crypt.jwt.Parser.setSigningKey( string secretKey )
- Parameters:
- secretKey -
- Returns:
- object
Ax.crypt.jwt.Parser.setSigningKey
-
object Ax.crypt.jwt.Parser.setSigningKey( object key )
- Parameters:
- key -
- Returns:
- object