CREATE OR REPLACE PACKAGE amfr_timestamp IS -- Author : RIDERC -- Created : 21/03/2007 16:33:56 -- Purpose : Package to store timestamping routines. -- -- PUBLIC constants -- g_URL CONSTANT VARCHAR2(255) := cout_system_configuration.get_configuration_item('G_TIMESTAMP_URL'); g_password CONSTANT VARCHAR2(255) := cout_system_configuration.get_configuration_item('G_TIMESTAMP_PASSWORD'); g_keystore CONSTANT VARCHAR2(255) := cout_system_configuration.get_configuration_item('G_TIMESTAMP_KEYSTORE'); -- C_Defaulted CONSTANT VARCHAR2(1) := 'D'; C_valid CONSTANT VARCHAR2(1) := 'V'; C_Invalid CONSTANT VARCHAR2(1) := 'I'; C_Retry CONSTANT VARCHAR2(1) := 'R'; C_Yes CONSTANT VARCHAR2(1) := 'Y'; -- C_test_run CONSTANT BOOLEAN := (C_Yes = cout_system_configuration.get_configuration_item('G_TEST_RUN')); -- C_Nomination CONSTANT VARCHAR2(1) := 'N'; C_Confirmation CONSTANT VARCHAR2(1) := 'C'; -- --- -- Don't know what format this will be! --- C_JAVA_DATA_FMT CONSTANT VARCHAR2(255) := 'DD-MON-YYYY HH24:MI:SS'; -- /** Wrapper for obtaining a timestamp from the timestamping service @param p_file BLOB file for the hashing algorithm @param p_URL VARCHAR2 URL for the timestamping service @param p_password VARCHAR2 password for the JKS keystore file @param p_keystore VARCHAR2 keystore file location e.g. C:\\temp\\keystore.jks @return The timestamp. */ FUNCTION Amtimestamp(p_File IN BLOB, p_Url IN VARCHAR2, p_Password IN VARCHAR2, p_Keystore IN VARCHAR2) RETURN VARCHAR2; /** Wrapper for obtaining the file has. @return the hash used by the last call to amTimestamp. */ FUNCTION Gethash RETURN VARCHAR2; /** Returns the entire response from the web service used for timestamping. @return the response as a BLOB. */ FUNCTION Getrespblob RETURN BLOB; /** Function to record a timestamp from a trusted source for the logging of document submission. This process inserts the timestamp into the DOCUEMTN_TIMESTAMPS table but relies on the calling procedure to COMMIT the transaction. @param p_identifier identifier for the document being timestamped @param p_docType Type of document being timestamped @param p_file_for_hash BLOB file for the hashing algorithm @param p_URL VARCHAR2 URL for the timestamping service @param p_password VARCHAR2 password for the JKS keystore file @param p_keystore VARCHAR2 keystore file location e.g. C:\\temp\\keystore.jks -- @return DATE the timestamp as an Oracle DATE. */ FUNCTION Timestamp_Document(p_Identifier IN Document_Timestamps.Doc_Identifier%TYPE, p_Doctype IN Document_Timestamps.Doc_Type%TYPE, p_File_For_Hash IN BLOB, p_Url IN VARCHAR2 DEFAULT g_URL, p_Password IN VARCHAR2 DEFAULT g_password, p_Keystore IN VARCHAR2 DEFAULT g_keystore) RETURN DATE; /** Procedure to retry the call to the timestamp service. @param p_identifier identifier for the document being timestamped @param p_docType Type of document being timestamped @param p_URL VARCHAR2 URL for the timestamping service @param p_password VARCHAR2 password for the JKS keystore file @param p_keystore VARCHAR2 keystore file location e.g. C:\\temp\\keystore.jks */ PROCEDURE retry_timestamp(p_Identifier IN Document_Timestamps.Doc_Identifier%TYPE, p_Doctype IN Document_Timestamps.Doc_Type%TYPE, p_Url IN VARCHAR2, p_Password IN VARCHAR2, p_Keystore IN VARCHAR2); END amfr_timestamp; /