TPP Certificate Verification
TPP Certificate Verification
The signing and verification flow of certificates for TPP requests is a follows:
Generation of the Request by TPP
Step 1: Calculating the Hash for the Digest Field
- TPP creates the body of the request (e.g., JSON containing transaction or consent data).
- TPP applies the SHA-256 algorithm to the body of the request to generate a unique hash.
- The resulting hash is encoded in Base64 and placed in the request header under the
Digestfield.
Step 2: Creating the Signing String
- TPP prepares a signing string based on specific fields from the request header.
- The signing string is a concatenation of the values of the signed fields in a specific format.
- The order of the fields is critical and follows the specifications.
Step 3: Signing the Signing String
- TPP uses its RSA private key associated with its certificate to generate a digital signature.
- The signature is applied to the signing string using the RSA-SHA256 algorithm.
- The resulting digital signature is Base64-encoded and placed in the
Signaturefield.
Step 4: Adding the Certificate to the TPP-Signature-Certificate Field
- TPP includes its public certificate in the request header under the
TPP-Signature-Certificatefield. - The certificate is issued by a trusted certification authority (CA) and contains the TPP's public key.
Step 5: Sending the Request to OBP
- TPP sends the complete request, including the
Digest,Signature, andTPP-Signature-Certificateheaders, to the OBP endpoint.
Verification of the Request by OBP
Step 1: Validating the TPP Certificate
- OBP verifies the TPP certificate included in the
TPP-Signature-Certificatefield.
Steps:
- Verify the certificate's trust chain up to a trusted certification authority.
- Ensure the certificate is valid (not expired or revoked).
- Confirm the certificate is issued for the appropriate usage (e.g., digital signatures for Open Banking), based on the information from the National Bank registry (e.g., certificate SN and CA found in the
Signaturefield).
- Result: If the certificate is valid, the TPP's identity is confirmed.
Step 2: Verifying the Signature in the Signature Field
- OBP extracts the fields included in the signing string based on the information in the
Signaturefield. - OBP recreates the signing string in the same format used by the TPP.
- OBP uses the public key from the certificate in the
TPP-Signature-Certificatefield to verify the signature in theSignaturefield. - Result: If the signature is valid, the authenticity of the request is confirmed.
Step 3: Verifying the Hash in the Digest Field
- OBP computes its own SHA-256 hash of the received request body.
- The computed hash is compared with the value in the
Digestheader. - Result: If the two hashes match, the integrity of the request body is confirmed.
Step 4: Authorizing the Request
- If all verifications (integrity, signature, and certificate) pass, OBP processes the request.
- Otherwise, the request is rejected with an error message (e.g.,
401 Unauthorizedor403 Forbidden).
Additional Details
How does OBP verify the signature in the Signature field?
- Extracts the public key from the
TPP-Signature-Certificate:- OBP retrieves the certificate (
TPP-Signature-Certificate) from the request header. - From this certificate, OBP extracts the TPP's public key.
- OBP retrieves the certificate (
- Recreates the Signing String:
- OBP analyzes the
Signatureheader to identify the signed fields (e.g.,Digest,X-Request-ID,Date, etc.). - OBP recreates the signing string from the actual values of these fields in the specified order.
- OBP analyzes the
- Decodes the Signature:
- OBP decodes the value in the
Signature.signaturefield (the digital signature generated by TPP). - Decoding is done using the public key extracted from the
TPP-Signature-Certificateand the algorithm specified inSignature.algorithm(e.g., RSA-SHA256).
- OBP decodes the value in the
- Compares the Resulting Hash:
- During decoding, OBP obtains a hash calculated by TPP at the time of signing.
- OBP compares this hash with the hash generated internally from the recreated signing string.
- Possible Outcomes:
- If the hashes match, the signature is valid.
- If the hashes do not match, the signature is invalid, and the request is rejected.