Signature XAdES détachée avec Manifest

Afficher en Markdown

Exemples de requête provisionnée

XAdES détachée avec Manifest

L’application demandeuse initie une demande de signature :

POST /api/requests HTTP/1.1
Authorization: ApiKey 5xVpCQPEYdncwHXwCDf5sqyfN9GPrio5
Content-Type: application/json
Content-Length: 158
{
"params" : {
"signerEmail" : "john.doe@my-idp.com"
},
"profiles" : {
"default" : {
"signatureType" : "xadesDetachedManifest"
}
}
}

Un objet demande est renvoyé, puis l’application demandeuse téléverse le contenu du document (un PDF) :

POST /api/requests/req_01_8KYPwGgLBVFt4jQSTzBM4tGt/profiles/default/documents HTTP/1.1
Authorization: ApiKey 5xVpCQPEYdncwHXwCDf5sqyfN9GPrio5
Content-Disposition: attachment; filename="document.pdf"
Content-Type: application/pdf
%PDF-1.3
%[contenu binaire du fichier PDF]

Un objet document est renvoyé, avec cette fois une policyUri pointant vers la politique de signature CAdES/XAdES détachée de la Banque de France. L’application demandeuse démarre ensuite la demande :

POST /api/requests/req_01_8KYPwGgLBVFt4jQSTzBM4tGt/start HTTP/1.1
Authorization: ApiKey 5xVpCQPEYdncwHXwCDf5sqyfN9GPrio5

Une fois la signature terminée, la liste des documents signés contient à présent deux parties distinctes : le document PDF d’origine (isOriginal: true) et un fichier signature.xml séparé contenant la signature XAdES détachée qui référence le PDF par son nom de fichier :

GET /api/requests/req_01_8KYPwGgLBVFt4jQSTzBM4tGt/signedDocuments HTTP/1.1
Authorization: ApiKey 5xVpCQPEYdncwHXwCDf5sqyfN9GPrio5
[ {
"created" : 1787667774032,
"displayedParts" : [ {
"contentType" : "application/pdf",
"filename" : "document.pdf",
"hash" : "obcUcumzUOJsClVDv/jHTNefKTRlTJULnZx4dfOrx+I=",
"isOriginal" : true,
"name" : "data",
"policyUri" : "https://sites.banque-france.fr/igc/signature/ps/ps_1_2_250_1_115_200_300_4.pdf",
"profileId" : "default",
"size" : 12341
}, {
"contentType" : "text/xml",
"filename" : "signature.xml",
"hash" : "FYxMrO3ydW9qvUGcX43cd62ELqzr+NYtUPTUo0Z4EMU=",
"isOriginal" : false,
"name" : "data",
"policyUri" : "https://sites.banque-france.fr/igc/signature/ps/ps_1_2_250_1_115_200_300_4.pdf",
"profileId" : "default",
"size" : 27176
} ],
"id" : "doc_3mUGMFSUbdezHkuaeSWmBmGH",
"linkedDocumentId" : "doc_N1B6L3yDYHR3uhHZvf867n8z",
"parts" : [ {
"contentType" : "application/pdf",
"filename" : "document.pdf",
"hash" : "obcUcumzUOJsClVDv/jHTNefKTRlTJULnZx4dfOrx+I=",
"isOriginal" : true,
"name" : "data",
"policyUri" : "https://sites.banque-france.fr/igc/signature/ps/ps_1_2_250_1_115_200_300_4.pdf",
"profileId" : "default",
"size" : 12341
}, {
"contentType" : "text/xml",
"filename" : "signature.xml",
"hash" : "FYxMrO3ydW9qvUGcX43cd62ELqzr+NYtUPTUo0Z4EMU=",
"isOriginal" : false,
"name" : "data",
"policyUri" : "https://sites.banque-france.fr/igc/signature/ps/ps_1_2_250_1_115_200_300_4.pdf",
"profileId" : "default",
"size" : 27176
} ],
"profileId" : "default",
"requestId" : "req_01_8KYPwGgLBVFt4jQSTzBM4tGt",
"workflowIdx" : 0
} ]

Le téléchargement du document signé renvoie le fichier signature.xml : une signature XAdES détachée (ds:Signature) qui référence document.pdf par son URI, avec sa politique de signature (celle de la Banque de France), sa chaîne de certificats et son horodatage :

GET /api/requests/req_01_8KYPwGgLBVFt4jQSTzBM4tGt/signedDocuments/doc_3mUGMFSUbdezHkuaeSWmBmGH HTTP/1.1
Authorization: ApiKey 5xVpCQPEYdncwHXwCDf5sqyfN9GPrio5
<?xml version="1.0" encoding="UTF-8"?><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="id-7c69b2b2c3f9bd9d8a83c85922048d7f">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<ds:SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
<ds:Reference Id="id-7c69b2b2c3f9bd9d8a83c85922048d7f-1" Type="http://www.w3.org/2000/09/xmldsig#Manifest" URI="#Manifestid-7c69b2b2c3f9bd9d8a83c85922048d7f">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue>lkHQNM4IfcZNvsKi4bE6XQbWOpr+CJWpQcG3d+rAP78=</ds:DigestValue>
</ds:Reference>
<ds:Reference Type="http://uri.etsi.org/01903#SignedProperties" URI="#xades-id-7c69b2b2c3f9bd9d8a83c85922048d7f">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue>RGK22mpeBaZOa3iV6Vee0COAv8fGjH5iyH4I97du+TU=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue Id="value-id-7c69b2b2c3f9bd9d8a83c85922048d7f">[valeur de signature encodée, tronquée]</ds:SignatureValue>
<ds:KeyInfo>...</ds:KeyInfo>
<ds:Object>
<xad:QualifyingProperties xmlns:xad="http://uri.etsi.org/01903/v1.3.2#" Target="#id-7c69b2b2c3f9bd9d8a83c85922048d7f">
...
</xad:QualifyingProperties>
</ds:Object>
<ds:Object>
<ds:Manifest Id="Manifestid-7c69b2b2c3f9bd9d8a83c85922048d7f">
<ds:Reference Id="Manifestid-7c69b2b2c3f9bd9d8a83c85922048d7f-1" URI="document.pdf">
<ds:DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256"/>
<ds:DigestValue>obcUcumzUOJsClVDv/jHTNefKTRlTJULnZx4dfOrx+I=</ds:DigestValue>
</ds:Reference>
</ds:Manifest>
</ds:Object>
</ds:Signature>