public class DBObjectInterfaceGenerator extends java.lang.Object implements Signer
The DBObjectInterfaceGenerator utility helps the developer in writing classes for the java/SIRA_PRISE bridging architecture (abbreviated JSBA) by generating java source files that define an interface for JSBA classes to implement. Without this utility, a programmer must carefully choose the names of the methods that are required by JSBA for a class to cooperate with a SIRA_PRISE relvar. With this utility, the developer can generate the interface definition that corresponds to a given SIRA_PRISE relvar, include that interface definition in his java project and implement the interface methods in his class(es).
Please see the main() method documentation for details on running the utility
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 DBObjectInterfaceGenerator utility helps the developer in writing classes for the java/SIRA_PRISE bridging architecture (abbreviated JSBA) by generating java source files that define an interface for JSBA classes to implement.
|
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) throws java.io.IOException
The DBObjectInterfaceGenerator utility helps the developer in writing classes for the java/SIRA_PRISE bridging architecture (abbreviated JSBA) by generating java source files that define an interface for JSBA classes to implement. Without this utility, a programmer must carefully choose the names of the methods that are required by JSBA for a class to cooperate with a SIRA_PRISE relvar. With this utility, the developer can generate the interface definition that corresponds to a given SIRA_PRISE relvar, include that interface definition in his java project and implement the interface methods in his class(es).
This utility writes two files in the specified output directory (see the discussion of the args[] argument). One file is named "DBObjectTo
", suffixed with the capitalized relvar name (i.e. the first character in uppercase, all the others in lowercase). The other file is named "ToDBObject
", prefixed with the capitalized relvar name.
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 |
The RELVAR argument can be passed, alternatively, as the first argument and without having to be enclosed in RELVAR() parentheses, as in : DBObjectInterfaceGenerator myrelvar host(...) port(...)
Options that are not specified via the command line, are set from the DBObjectInterfaceGeneratorProperties object.
java.io.IOException
- -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 Signaturepublic 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 bytes