简体   繁体   English

PSD2 QSealC签名的消息

[英]PSD2 QSealC signed message

I have looked everywhere for an example of a QSealC signed message, and I could not find any info. 我到处都在寻找QSealC签名消息的示例,但找不到任何信息。 I need to verify the signature of a QsealC signed payload AND I need to sign the responding payload but I understand that the payload is all in json, 我需要验证QsealC签名的有效负载的签名,并且需要对响应的有效负载进行签名,但是我知道该有效负载全部在json中,

Are there examples out there of QSealC signed payloads? 是否有QSealC签名的有效负载示例?

thanks 谢谢

You will do both the signing and validation as detailed by IETF's draft-cavage-http-signatures , where you should pay special attention to section 4.1.1 for constructing and section 2.5 for verifying the Signature header. 您将按照IETF的draft-cavage-http-signatures的详细说明进行签名和验证,在此应特别注意4.1.1节的构造和2.5节的Signature标头验证。

This draft is referenced by both Berlin Group's XS2A NextGenPSD2 Framework Implementation Guidelines and Stet (France). 柏林集团的XS2A NextGenPSD2框架实施指南Stet (法国)均参考了该草案。 However, note that it's normal that each unique implementation imposes additional requirements on the HTTP Message Signing standard, eg by requiring specific headers to be signed or using a specially formatted keyId. 但是,请注意,通常每个唯一的实现都会对HTTP消息签名标准施加其他要求,例如,通过要求对特定的标头进行签名或使用特殊格式的keyId。 I am not sure whether other standardization's such as Open Banking (UK) reference it. 我不确定其他标准,例如开放银行 (UK)是否引用了它。

Take note that you do not need actual QsealC PSD2 certificates to begin your implementation work of the neither the signing nor validation process, as you can create your own self-issued certificates, eg using OpenSSL, by adding the OID's found in the ASN.1 profile described in ETSI TS 119 495 . 请注意,您不需要实际的QsealC PSD2证书即可开始执行签名或验证过程,因为您可以通过添加在ASN.1中找到的OID来创建自己的自发行证书,例如使用OpenSSL。 ETSI TS 119 495中描述的轮廓。

However, I strongly recommend you find a QTSP in your region and order certificates both for development and testing, and for use in production when the time comes. 但是,我强烈建议您在您所在的地区找到QTSP并订购证书以进行开发和测试,并在时间到时用于生产。

I won't go into details on the actual process of creating the signature itself, as it's very well detailed in draft-cavage-http-signatures , but consider the following example; 我不会详细介绍创建签名本身的实际过程,因为在draft-cavage-http-signatures中已经非常详细地介绍了该示例,但是请考虑以下示例。

You're requesting GET https://api.bank.eu/v1/accounts , and after processing your outgoing request you end up with the following signing string; 您正在请求GET https://api.bank.eu/v1/accounts ,并且在处理了外发请求后,您将得到以下签名字符串;

date: Sun, 12 May 2019 17:03:04 GMT
x-request-id: 69df69c1-76d0-4590-8f28-50449a21d0d8
psu-id: 289da2e6-5a01-430d-8075-8f7af71f6d2b
tpp-redirect-uri: https://httpbin.org/get

The resulting Signature could look something like this; 生成的Signature可能看起来像这样。

keyId=\"SN=D9EA5432EA92D254,CA=CN=Buypass Class 3 CA 3,O=Buypass AS-983163327,C=NO\",
algorithm=\"rsa-sha256\",
headers=\"date x-request-id psu-id tpp-redirect-uri\",
signature=\"base64(rsa-sha256(signing_string))\"

The above signature adheres to Berlin Group requirements as detailed in Section 12.2 in their implementation guidelines (per. v1.3), except some linebreaks added for readability, which in short are ; 上面的签名符合柏林集团在实施准则(第v1.3版)中第12.2节中详述的要求,但为便于阅读而添加了一些换行符,简称为;

  1. the keyId must be formatted as SN={serial},CA={issuer} , but note that it seems to be up to the ASPSP to decide how the serial and issuer is formatted. keyId的格式必须为SN={serial},CA={issuer} ,但是请注意,似乎由ASPSP决定串行和发行者的格式。 However, most are likely to require the serial to be in uppercase hexadecimal representation and issuer formatting in conformance with RFC 2253 or RFC 4514. 但是,大多数可能要求序列号以大写十六进制表示和发行者格式,以符合RFC 2253或RFC 4514的要求。

  2. The algorithm used must be either rsa-sha256 or rsa-sha512 使用的算法必须是rsa-sha256rsa-sha512

  3. The following headers must be part of the signing string if present in the request; 如果请求中存在以下标头,则它们必须是签名字符串的一部分; date , digest , x-request-id , psu-id , psu-corporate-id , tpp-redirect-uri datedigestx-request-idpsu-idpsu-corporate-idtpp-redirect-uri

  4. The signature must be base-64 encoded 签名必须是base-64编码的

As developers have just begun to adopt this way of signing messages, you'll likely have you implement this yourself - but it's not too difficult if you just carefully read the above mentioned draft. 当开发人员刚刚开始采用这种对消息进行签名的方式时,您可能会自己实现这一点-但是,只要您仔细阅读上述草案,就不会太困难。

However, vendors have begun supporting the scheme, eg Apache CXF currently supports both signing and validation from v3.3.0 in their cxf-rt-rs-security-http-signature module as mentioned in the Apache CXF 3.3 Migration Guide . 但是,供应商已经开始支持该方案,例如,Apache CXF目前支持其cxf-rt-rs-security-http-signature模块中的v3.3.0中的签名和验证,如Apache CXF 3.3迁移指南中所述 Surely, others will follow. 当然,其他人也会效仿。

Validating the actual signature is easy enough, but validating the actual QsealC PSD2 certificate is a bit more cumbersome, but you'll likely have to integrate with EU's List of Trusted Lists to retrieve root- and intermediate certificates used to issued these certificates, and form a chain of trust together with eg Java's cacerts and Microsoft Trusted Root Certificate Program . 验证实际签名很容易,但是验证实际QsealC PSD2证书比较麻烦,但是您可能必须与EU的“受信任列表”集成以检索用于颁发这些证书的根证书和中间证书,并形成信任链,例如Java的cacertsMicrosoft可信根证书计划 I personally have good experiences using difi-certvalidator (Java) for the actual validation process, as it proved very easy to extend to our needs, but there are surely many other good tools and libraries out there. 我个人在实际验证过程中使用difi-certvalidator (Java)有很好的经验,因为事实证明它很容易扩展到我们的需求,但是肯定还有许多其他好的工具和库。

You'll also need to pay special attention the certificate's organizationIdentifier (OID: 2.5.4.97) and qcStatements (OID: 1.3.6.1.5.5.7.1.3) . 您还需要特别注意证书的organizationIdentifier (OID: 2.5.4.97)qcStatements (OID: 1.3.6.1.5.5.7.1.3) You should check the certificate's organizationIdentifier against the Preta directory, as there might be instances where a TPP's authorization is revoked by it's NCA, but a CRL revocation hasn't yet been published by it's QTSP. 您应该对照Preta目录检查证书的organizationIdentifier,因为在某些情况下,TPP的授权被其NCA撤消,但是其QTSP尚未发布CRL吊销。

DISCLAIMER: When it comes to the whole QsealC PSD2 certificate signing and validation process, I find both Berlin Group and EBA to be very diffuse, leaving several aspects open to interpretation. 免责声明:关于整个QsealC PSD2证书签名和验证过程,我发现Berlin Group和EBA都非常分散,有几个方面可以解释。

This is a rough explanation, but hopefully it give you enough to get started. 这是一个粗略的解释,但希望它能给您足够的入门知识。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM