public class DBObjectGenerator extends java.lang.Object implements Signer
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
RELVAR
The name for the default option when invoking the DBObjectInterfaceGenerator
|
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)
The DBObjectGenerator utility helps the developer to write jsba-annotated classes for the java/SIRA_PRISE bridging architecture (abbreviated JSBA).
|
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 RELVAR
public static void main(java.lang.String[] args)
args
- The options for the utility can be passed via the command line using the following syntax for each option : optionname(optionvalue)
. The following options can be passed :
Option name | Description | Default value |
---|---|---|
HOST |
The hostname or IP address of the SIRA_PRISE server to which to connect. | LOCALHOST |
PORT |
The IP port number on the server to which to connect | 50000 |
RELVAR |
The name of the relvar for which to generate an interface definition. | no default. |
OUTPUTDIRECTORY |
The directory where the script processor's output is to be written. This option can only be set on the command line, not in a properties file. | No default |
PACKAGE |
The package name to which the generated class will belong. | No default |
The RELVAR argument can be passed, alternatively, as the first argument and without having to be enclosed in RELVAR() parentheses, as in : DBObjectGenerator myrelvar host(...) port(...)
Options that are not specified via the command line, are set from the DBObjectGeneratorProperties object.
public 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 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