HPDFParsePSD2QcStatement Function
Parses the DER of one ETSI TS 119 495 PSD2QcType into a THPDFPSD2QcStatement and rejects any malformed input as a whole
Declaration
function HPDFParsePSD2QcStatement(const StatementInfoDER: TBytes;
out Statement: THPDFPSD2QcStatement): boolean;
Unit
HPDFSignVerify
Parameters
| Parameter | Purpose |
|---|---|
StatementInfoDER | The statementInfo of the QCStatement 0.4.0.19495.2: exactly one DER-encoded SEQUENCE { rolesOfPSP, nCAName, nCAId } |
Statement | Receives the roles and the NCA name and identifier; empty whenever the function returns false |
Return value
true when the buffer holds a well-formed PSD2QcType; false for an empty buffer and for any of the deviations below
Rejected input
- Lengths that overrun their parent, non-minimal length encodings and indefinite lengths
- Bytes after the outer
SEQUENCE - Missing or extra components and components with the wrong tag:
rolesOfPSPmust be aSEQUENCE OF SEQUENCE { OBJECT IDENTIFIER, UTF8String },nCANameandnCAIdmust beUTF8String - Role names, NCA names and NCA identifiers that are not 1 to 256 characters of valid UTF-8
Example
var
Statement: THPDFPSD2QcStatement;
I: Integer;
begin
if HPDFParsePSD2QcStatement(StatementInfoDER, Statement) then
begin
for I:= 0 to High(Statement.RolesOfPSP) do
Writeln(Statement.RolesOfPSP[I].Name, ' (', Statement.RolesOfPSP[I].OID, ')');
Writeln('NCA: ', Statement.NCAName, ' / ', Statement.NCAId);
end;
end;
Usage notes
- The defined role OIDs are
0.4.0.19495.1.1(PSP_AS, account servicing),0.4.0.19495.1.2(PSP_PI, payment initiation),0.4.0.19495.1.3(PSP_AI, account information) and0.4.0.19495.1.4(PSP_IC, issuing of card-based payment instruments) - The function reads DER you already hold; to read the statement from a signature, use
HPDFEvaluateCMSSignerQCStatementson the CMS data orTHotPDF.GetLoadedSignatureQCStatementson a loaded document