HPDFParsePSD2QcStatement Function
Turns the DER of a single ETSI TS 119 495 PSD2QcType into a THPDFPSD2QcStatement, rejecting malformed input outright
Declaration
function HPDFParsePSD2QcStatement(const StatementInfoDER: TBytes;
out Statement: THPDFPSD2QcStatement): boolean;
Unit
HPDFSignVerify
Parameters
| Parameter | Purpose |
|---|---|
StatementInfoDER | The statementInfo of QCStatement 0.4.0.19495.2: precisely one DER-encoded SEQUENCE { rolesOfPSP, nCAName, nCAId } |
Statement | Receives the roles plus the NCA name and identifier; left empty whenever the function returns false |
Return value
true when the buffer holds a well-formed PSD2QcType; false for an empty buffer and for each of the deviations listed below
Rejected input
- Lengths that overrun their parent, non-minimal length encodings and indefinite lengths
- Any bytes after the outer
SEQUENCE - Missing or extra components, and components carrying the wrong tag:
rolesOfPSPmust be aSEQUENCE OF SEQUENCE { OBJECT IDENTIFIER, UTF8String }, whilstnCANameandnCAIdmust 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 out of a signature, apply
HPDFEvaluateCMSSignerQCStatementsto the CMS data orTHotPDF.GetLoadedSignatureQCStatementsto a loaded document