Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLIENTID
The client ID that is used by the script processor if a script is run on a DBConnection with client authentication.
|
static java.lang.String |
CONTINUATION
The line continuation sequence.
|
static java.lang.String |
SPS
The suffix by which script files can be recognized
|
Modifier and Type | Method and Description |
---|---|
byte[] |
decryptSecret(java.security.Signature signature,
java.lang.String cipherInfoCipherName,
byte[] encryptedSecret)
Decrypts an encrypted secret, encryption of which was done using the public key corresponding to the private key we also use to sign messages with
|
static void |
main(java.lang.String[] args)
Runs a series of commands through the server
|
void |
run() |
byte[] |
sign(java.security.Signature signature,
byte[] signMessage)
Computes the signature for the given byte string and the given Signature.
|
public static final java.lang.String CONTINUATION
public static final java.lang.String CLIENTID
public static final java.lang.String SPS
public static void main(java.lang.String[] args) throws java.io.IOException
args
- the command line arguments set the options for the process to be run. The arguments are to be provided in the format specified by MyCommandLineParameters.getCommandLineParameters(String[], String, Properties)
. The options that can be provided are specified by ProcessScriptProperties
and its parent Properties DBConnectionProperties
.java.io.IOException
- If an IO exception occurred during processing setuppublic byte[] decryptSecret(java.security.Signature signature, java.lang.String cipherInfoCipherName, byte[] encryptedSecret) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException, javax.crypto.NoSuchPaddingException, NotFoundException, javax.crypto.IllegalBlockSizeException, javax.crypto.BadPaddingException
Signer
decryptSecret
in interface Signer
signature
- The Signature object to be used for computing the signature.cipherInfoCipherName
- The name of the Cipher used to encrypt the secretencryptedSecret
- A secret to be shared between [the user of] this signer and a party we are communicating with, and who generated the secret, encrypting it with our public key.java.security.InvalidKeyException
- If the public key in the given certificate is inappropriate for initializing this cipher, or this cipher requires algorithm parameters that cannot be determined from the public key in the given certificate, or the keysize of the public key in the given certificate has a keysize that exceeds the maximum allowable keysize (as determined by the configured jurisdiction policy files).java.security.NoSuchAlgorithmException
- If the cipherInfoCipherName does not indicate a usable Cipher namejavax.crypto.NoSuchPaddingException
- If the cipherInfoCipherName does not indicate a usable Cipher nameNotFoundException
- If the private key to be used for the decryption could not be foundjavax.crypto.IllegalBlockSizeException
- If cipherInfoCipherName indicates a block cipher, no padding has been requested (only in encryption mode), and the total input length of the data processed by this cipher is not a multiple of block size; or if this encryption algorithm is unable to process the input data provided.javax.crypto.BadPaddingException
- If this cipher is in decryption mode, and (un)padding has been requested, but the decrypted data is not bounded by the appropriate padding bytespublic void run()
run
in interface java.lang.Runnable
public byte[] sign(java.security.Signature signature, byte[] signMessage) throws java.security.InvalidKeyException, java.security.SignatureException, NotFoundException
Signer
sign
in interface Signer
signature
- The Signature object to be used for computing the signature.signMessage
- The message to be signed.java.security.InvalidKeyException
- If the private key found for signing with this Signature, turns out to be invalidjava.security.SignatureException
- If any problem occurred during computation of the signatureNotFoundException
- If no private key could be found for signing with this Signature