Firmar varios hashes en Postman con un SAD
Esta guía utiliza el método de autenticación Flujo de credenciales del cliente. Explica qué llamadas a la API deben ejecutarse y cuántas veces es necesario realizar la ejecución para firmar varios hashes con un solo SAD.
Nota
En este método, se necesita precalcular la cantidad de hashes deseados con las llamadas a la API “3 - PDF Service: Registrar un documento” y “4 - PDF Service Crear un hash” antes de ejecutar “6 - DTM: extendTransaction” y “7 - DTM: Firmas CSC SignHash”.
La firma en la respuesta “7 - DTM: Firmas CSC SignHash” corresponde al orden de los hashes enviados en su solicitud de llamada a la API.
Puede ejecutar la llamada a la API “8 - PDF Service: Incrustar firma” hasta 200 veces por ciclo para incrustar las firmas en los documentos.
Para firmar un hash, ejecute las solicitudes a la API que figuran a continuación:
Nota
Este autentificador es válido por una hora, pero DigiCert® puede extenderlo 24 horas más.
En la ventana de Postman, seleccione Colecciones (menú ubicado a la izquierda) > PDF Service 2.0 > Lista de credenciales DTM CSC.
En la ventana de la derecha, cambie a la pestaña Autorizaciones.
Seleccione Obtener un nuevo autentificador de acceso.
En la nueva ventana emergente, seleccione Continuar.
Para aplicar el autentificador de acceso, seleccione Usar autentificador.
Para obtener una lista de las credenciales (certificados) almacenados en su cuenta de DigiCert ONE, haga lo siguiente:
Abra la colección PDFService-2-0-SealSign CADES - Flujo de autentificadores de API - La firma visible funciona.
Seleccione 1 - Lista de credenciales DTM CSC > Enviar.
En el cuerpo del mensaje se muestran los CredentialIDs (certificados) usados de DigiCert ONE.
Para obtener una visión general de las funciones utilizadas en DigiCert ONE, siga estos pasos:
Seleccione 2 - Información sobre las credenciales DTM CSC > Enviar.
Verá las funciones utilizadas en DigiCert ONE.
PDF document
To register a PDF document:
Select 3 - Content Signing Service: Register Document.
Configure "tsa_url" variable value by entering the URL of the timestamp authority you use to sign documents.
Select Send.
To change signature appearance, use the following configurations:
Configuration | Description |
|---|---|
type (optional) | Depending on the type, you’re able to create a certified MDP (document modification detection and prevention) document. Default isn’t certified and shows a green tick. Certified shows a ribbon with a seal. Examples: NOT_CERTIFIED CERTIFIED_NO_CHANGES_ALLOWED CERTIFIED_FORM_FILLING CERTIFIED_FORM_FILLING_AND_ANNOTATIONS |
preservation_size (optional) | Enter preservation size of the space for embedding the signature in bytes. Value should be a multiple of 1024. (Format: int32). |
signature_rectangle (optional) | Set the position and size of the digital signature annotation. The default is an invisible signature. The position is defined by four values for the lower-left corner (x, y) and dimensions (w, h) of the rectangle. The units are document points (1 point = 1/72 inch, A4 = 595 x 842 points, letter = 612 x 792 points, 1cm = 28.3465 points) measured from the lower left corner of the page. If either the width or height is zero or negative, an invisible signature is created, that is, no visible appearance is created for the signature. (Format: int32). page: Enter page on which the signature is added. x: Enter x value of lower-left corner. y: Enter y value of lower-left corner. w: Enter width dimension of rectangle. h: Enter height dimension of rectangle. |
signature_text1 (optional) | Enter specific signature text instead of standard. (Example: signer's name). |
reason (optional) | Enter reason. |
contact (optional) | Enter contact. |
font_text1 (optional) | Enter name of the font. |
font_size_text1 (optional) | Enter font size of signature text 1. If attribute isn’t present default of 16pt is used. (Format: int32). |
signature_text2 (optional) | Enter specific signature text instead of standard. (Example: signer’s name, reason and/or signing time). |
font_text2 (optional) | Enter name of the font. |
font_size_text2 (optional) | Enter font size of signature text 2. If attribute isn’t present default of 8pt is used. (Format: int32). |
signature_fill_color (optional) | Enter background color in RGB. The default is 16761024 (red = 192, green = 192, blue = 255). Color value is calculated as follows: color red + green * 256 + blue * 256 * 256. To keep the rectangle transparent, set the value to -1. (Format: int32). |
signature_stroke_color (optional) | Enter the color of the signature’s border line as RGB value. The default is 8405056 (red = 64, green = 64, blue = 128). Color value is calculated as follows: color red + green * 256 + blue * 256 * 256. To keep it transparent, set the value to -1. (Format: int32). |
signature_line_width (optional) | Enter the thickness of the line surrounding the visual signature in points. (Format: int32). |
background_image (optional) | Insert the image to be embedded in the signature field. (Base64 encoded). (Example: "dGVzdA==”). |
XML document
To register an XML document:
Select 3 - Content Signing Service: Register Document.
Configure "tsa_url" variable value by entering the URL of the timestamp authority you use to sign documents.
Select Send.
Use the following configurations:
Configuration | Description |
|---|---|
canonicalization_method | Enter the canonicalization method for XML signing. Examples: INCLUSIVE or EXCLUSIVE |
signature_type | Enter signature type of the XML document to be signed. Examples: XAdES.enveloped/ or XAdES.enveloping |
Para crear un hash, haga lo siguiente:
Adjunte el documento.
Seleccione 4 - PDF Service: Crear hash > Enviar.
Repita el paso 3. “Registrar un documento” y el paso 4. “Crear un hash” de forma consecutiva hasta alcanzar la cantidad de hashes que desea calcular.
Recibirá los DocumentIDs y sus correspondientes hashes.
Sugerencia
Suba diferentes documentos en PDF después de cada ejecución del paso 3. “Registrar un documento” para calcular hashes y probar con documentos distintos.
Para crear un dato de activación de firma (Signature Activation Data, SAD) y comenzar la autorización utilizando la aplicación Go>Sign Mobile, haga lo siguiente:
Seleccione 5 - DTM: Autorizar la credencial CSC > Enviar.
Diríjase a la aplicación Go>Sign Mobile > Solicitud de autorización > Autorizar.
Recibirá un SAD válido requerido para firmar el hash. Necesitará este dato en el paso “Incrustar firma”.
Nota
En el entorno de demostración de DigiCert ONE, los valores predeterminados para la reautorización utilizando la aplicación Go>Sign Mobile se fijan en “250,000 hashes o 30 días”.
En el entorno de producción de DigiCert ONE, los valores predeterminados para la reautorización utilizando la aplicación Go>Sign Mobile se fijan en “1 millón de hashes o 95 días”.
Para firmar un hash, siga estos pasos:
Seleccione 7 - DTM: Firmas CSC SignHash > Enviar.
Recibe una firma por cada hash enviado.
Para firmar un hash nuevo, siga estos pasos:
Seleccione 8 - PDF Service: Incrustar firma.
Se actualizará automáticamente el SAD generado en el paso Autorizar credencial.
Seleccione Enviar.
Repita este paso nuevamente para cada firma de forma individual en el orden en que las recibió en “4 - PDF Service: Crear un hash”.
Para descargar el PDF y verificar la validez de la firma, siga estos pasos:
Seleccione Guardar como ejemplo (parte inferior derecha) > Guardar respuesta en archivo.