Vous êtes sur la page 1sur 16

......................................................................................................................................

Livre Blanc de sécurité SOA.


Sécurité des données. XML
Signature, XML Encryption. v.1.0

Project Documentation

......................................................................................................................................
OpenCap - Ahmed ALAMI 09 December 2005
TABLE OF CONTENTS i

Table of Contents
......................................................................................................................................

1 Introduction
1.1 Avant Propos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2 La Mise en Oeuvre
2.1 Sécurité Niveau Données . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2.1.1 XML Signature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.1.2 XML Encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8


2.2 Les Solutions Open Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3 Annexes
3.1 Où trouver les spécifications? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

©2005 OPENCAP - AHMED ALAMI • ALL RIGHTS RESERVED


TABLE OF CONTENTS ii

©2005 OPENCAP - AHMED ALAMI • ALL RIGHTS RESERVED


1.1 AVANT PROPOS 1

1.1 Avant Propos


......................................................................................................................................

 
     
   
         
!  
" # 
  
     
    $   %    &"'

% ( ( ) *+

 
    
   
    
    
 

  
             
 ! "   
  
    
 # 
           $   

  
            
   
    
 !

%
        &   
    
 
   
 '( 
       )

* La sécurité niveau Transport )  + ' # ( ,-. ',   -   .#/(  
 
  +   
0 
* La sécurité niveau Message ) 1      2  
           

   
   
                  

3
 
!
* Sécurité niveau application ) 
  
       
 456 
   
  !
* Sécurité niveau Données ) "0               
/
   !
* Sécurité niveau Environnement ) 7                3 
  8         

  9   !


  
 #        
   
   
  
     ! :   
 
   
  
 #  
 
      
      
     
   
 
  

 ! 4   
 #   
  


 
         
!

 
 #       
    '   
      ( )

* %    03  +;+ 


* %    
   
* "         6 
* 4+6 
* "    
  
* -
     03    
* <
  
9 
0
          
  03    

©2005 OPENCAP - AHMED ALAMI • ALL RIGHTS RESERVED


1.1 AVANT PROPOS 2

    


   
 #    
  

    )

*   
 
*     
* 
   
*   
*  +  

4  


  03  
     
     
    
0    
 
     
   # 
!

      


 #   8            
  ;   
     
 
    ! 1                   
     
    
       ! =      
     2        8
               

 ;      ! 1      
    +    
8    
            '
 > (!

 
 #      
          ) %  
   ?      ':7@( 03    A ! 

  


  
    !

 
                      

    
/ ! 

       

  =                  
    
 # ! B       2       

 
    WS-Security            
    
  
      SAML        
       
         ;   
           
      
 

              ! %    ;    
    

   ; 
 Kerberos  XKMS  XACML     

  ;  
/  
 !

 
          
          


   +;+ !                        

 
 

        
     !

©2005 OPENCAP - AHMED ALAMI • ALL RIGHTS RESERVED


2.1 SéCURITé NIVEAU DONNéES 3

2.1 Sécurité Niveau Données


......................................................................................................................................

C7     


             
   

   
      
  8      
  ! =

 ; C7
       
     
   0 +6       
  ! "
 
 
     
  
 
  
    

 
 ! " 
   
   
0    
    
 C7
         !

-   3    ) :  


        
 ;   
 

             
   

 
  
  !       
        
        ;

      0   ;
   !

      
      ;
        )  
 
 
 
! =     ! 
   ;     
      
        !

 
   
 
  

       
  
    ;  
 # ! "  
   

      
  
  C7 
 
          8 ! -  
 ?
0  
 :    

3         


    ?  
      !

 

  7 C"7  CD7         
   
 
    
  ! " 

    
   
 
 E
 8 
 
 !

%       


 
      C7   8   
   -         
    8   

3 
 ! +
 0     
  C7 40      
    
      -     
   
   
 
    
  
 -  :      
  
       
     
 C7!

1  
2  

0  C7     C7        F

 
     

©2005 OPENCAP - AHMED ALAMI • ALL RIGHTS RESERVED


2.1.1 XML SIGNATURE 4

2.1.1 XML Signature


......................................................................................................................................

    C7                 
    
 
          !           C7      

3  
      

 ;      
   
 C7!
"     8        
             
 
  ;    8  
 !

C7        0          
 B=7
  
   ' 
  @%-( 
 C7 !!!

 
            C7  
     2      
 
 2   ! C7      
 
 ;      )
* 1 1<%
*  8   
   
* 4   8  
   '      3(
* 4  2   '       (!

     
 C7     
0 !

:G

     ;
 
 
  
      C7  ;     
   
 G 
 C7         
     
  

  !      
  C7        H

 ?   I 

   
 0    03  
    
 !

 G       


 

 ?            
 
C7 
                      
   !

   
  G 
  03
  
  J         C7J
      
   

0       

0 3! = 

0 3      
0 K G             
8  

 ?   
  
      ;     
   

 C7!

Les composants de XML Signature

Balise Description
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Reference Chaque ressource à signer est associée à sa propre référence identifiée via l’attribut URI.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Transforms Cet élément spécifie la liste des étapes appliquées au contenu de la ressource référencée avant de subir un digest.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
DigestValue Cet élément comporte la valeur du digest correspondant à la ressource référencée.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

©2005 OPENCAP - AHMED ALAMI • ALL RIGHTS RESERVED


2.1.1 XML SIGNATURE 5

SignatureValue Cet élément spécifie la valeur du digest crypté de l’élément Signedinfo


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
KEyInfo Cet élément indique la clef à utiliser pour valider la signature. Cette information peut renseigner aussi bien des
certificats, des noms de clefs, des algorithmes d’arrangement (agreement keys)

Comment utiliser XML Signature ?


" +  
        ;       
 C7 )

L! :   


 ;    
 ;  
 ;  1<%   0  

    )
* )>>###!
!> 
 +! '
 ;  
 B=7(
* )>>###!
!>   +!2 '
 ;   (
* )>>###!
!> 
 +! '
  
   
 +!(
* )>>###!
!> 
 +!M  '
 ;       

   
 +!(
N! :     
  
 ;  !

"  
  
 ;   O<
P   
    
  
 O: , P   

<Reference
URI="http://www.opencap.org/transaction-result.xml">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue>UrXLDLBIta6skoV5/A8Q38GEw44=</DigestValue>
</Reference>

O: 7P 
        

   !

Q! "
   O<
P

4  


     O %P    )

<SignedInfo Id="id">
<CanonicalizationMethod
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
<Reference
URI="http://www.opencap.org/transaction-result.xml">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue>UrXLDLBIta6skoV5/A8Q38GEw44=</DigestValue>
</Reference>
</SignedInfo>

©2005 OPENCAP - AHMED ALAMI • ALL RIGHTS RESERVED


2.1.1 XML SIGNATURE 6

 O" 


 ?  7P         
  
O %P! O  7P                 
  !

R!    

" 
      O %P       
   

<SignatureValue>VVVVVVVV=</SignatureValue>

S! 2    

%
 
       
          )

<KeyInfo>
<X509Data>
<X509SubjectName>CN=AALAMI,O=OpenCap.,ST=BDX,C=FR</X509SubjectName>
<X509Certificate>MIID5lVN</X509Certificate>
</X509Data>
</KeyInfo>

T! "   
 C7   )

<?xml version="1.0" encoding="UTF-8"?>


<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo Id="id">
<CanonicalizationMethod
Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#dsa-sha1" />
<Reference
URI="http://www.opencap.org/transaction-result.xml">
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue>UrXLDLBIta6skoV5/A8Q38GEw44=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>VVVVVVVV=</SignatureValue>
<KeyInfo>
<X509Data>
<X509SubjectName>CN=AALAMI,O=OpenCap.,ST=BDX,C=FR</X509SubjectName>
<X509Certificate>MIID5lVN</X509Certificate>
</X509Data>
</KeyInfo>

</Signature>

©2005 OPENCAP - AHMED ALAMI • ALL RIGHTS RESERVED


2.1.1 XML SIGNATURE 7

©2005 OPENCAP - AHMED ALAMI • ALL RIGHTS RESERVED


2.1.2 XML ENCRYPTION 8

2.1.2 XML Encryption


......................................................................................................................................

 
    =   
   
   ++       
   
0  
   ! -           2   
#/#  03         0    
 
     
   
 
   
            
     
 

           
  ++
  

 ;! 1
      
  
0 
       
    

  
 0   
  E 
              
  !

C7 4
0   ;
 
        
  
     

C7 
    
  !

C7 4
0    3           8 
    
                  
 $     

 
                   
 $      

!

C7 4
0        
0     8 )
* :    
* 1  C7
* 
   C7!

 
0     
   C7  4
0:  

  
 '
 (     
0  
 C7!

 
0       '0
   
 C7  ( 
4
0:      
    
 C7         
 
 C7
     
 !

 O4
0:  P 
     +
       

0    
  
 
   '  
 ;

(!

C7 4
0                
    
 ;

0        !

" +  


   4
0:  )

<EncryptedData Id? Type?>


<EncryptionMethod/>?
<ds:KeyInfo>
<EncryptedKey>?
<AgreementMethod>?
<ds:KeyName>?

©2005 OPENCAP - AHMED ALAMI • ALL RIGHTS RESERVED


2.1.2 XML ENCRYPTION 9

<ds:RetrievalMethod>?
<ds:*>?
</ds:KeyInfo>?
<CipherData>
<CipherValue>?
<CipherReference URI?>?
</CipherData>
<EncryptionProperties>?
</EncryptedData>

Exemple
,
    
  C7       
  ;     

 
  
 ! =   
 !

<?xml version='1.0'?>
<PaymentInfo xmlns='http://example.org/paymentv2'>
<Name>John Smith<Name/>
<CreditCard Limit='5,000' Currency='USD'>
<Number>4019 2445 0277 5567</Number>
<Issuer>Bank of the Internet</Issuer>
<Expiration>04/02</Expiration>
</CreditCard>
</PaymentInfo>

  3  


  ;
0  
   
+   !

<?xml version='1.0'?>
<EncryptedData xmlns='http://www.w3.org/2001/04/xmlenc#'
Type='http://www.isi.edu/in-notes/iana/assignments/media-
types/text/xml'>
<CipherData><CipherValue>A23B45C56</CipherValue>
</CipherData>
</EncryptedData>

C7 4
0     +
0 
+    ! 1 
 C7 

  ?    4


0:  !  4
0:    8    
     4
0:  ! "   
0     8
    0
    4
0:   4
0D0

<pay:InfoPaiement xmlns:pay='http://exemple.org/paiementv2'>
<EncryptedData Id='ED1' xmlns='http://www.w3.org/2001/04/xmlenc#'

©2005 OPENCAP - AHMED ALAMI • ALL RIGHTS RESERVED


2.1.2 XML ENCRYPTION 10

Type='http://www.w3.org/2001/04/xmlenc#Element'>
<CipherData>
<CipherValue>EncryptedDataOriginal</CipherValue>
</CipherData>
</EncryptedData>
</pay:InfoPaiement>

4     C7 4
0       
0       ; 
 
 

 ! " +    


0          =0     O4
0:  P
    

0
 ;   C7!

<?xml version='1.0'?>
<PaymentInfo xmlns='http://example.org/paymentv2'>
<Name>John Smith<Name/>
<EncryptedData Type='http://www.w3.org/2001/04/xmlenc#Element'
xmlns='http://www.w3.org/2001/04/xmlenc#'>
<CipherData><CipherValue>A23B45C56
</CipherValue></CipherData>
</EncryptedData>
</PaymentInfo>

  3  


  ;
0     
 
! " +    
       =0     O4
0:  P     

0

; 
   C7!

<?xml version='1.0'?>
<PaymentInfo xmlns='http://example.org/paymentv2'>
<Name>John Smith<Name/>
<CreditCard Limit='5,000' Currency='USD'>
<Number>
<EncryptedData xmlns='http://www.w3.org/2001/04/xmlenc#'
Type='http://www.w3.org/2001/04/xmlenc#Content'>
<CipherData><CipherValue>A23B45C56</CipherValue>
</CipherData>
</EncryptedData>
</Number>
<Issuer>Bank of the Internet</Issuer>
<Expiration>04/02</Expiration>
</CreditCard>
</PaymentInfo>

©2005 OPENCAP - AHMED ALAMI • ALL RIGHTS RESERVED


2.2 LES SOLUTIONS OPEN SOURCE 11

2.2 Les Solutions Open Source


......................................................................................................................................

%     2           



     ;  
  

  !   2  
           5   "UU! " + 

    2  
  )

* 
 C7 
 0 ) " 2               
 
   ; C7! "     C7+    C7 -
 !  2       
 

  C7 D0 7   'CD7(
* 7
        3   
 5   "UU   

  
 

  7 L!V  L!L!
* 
 : 
0 -2
 ) " 2      
 
  )
* 1  #/   
  ) C
* 1    
   <W" D 
* " -# 
          3 
 !
* ,   +
 0 /  )      
  
            
+
 0      
  
     
  !
*  "0 -%  6
0 "  
      )
* 1 -% 3 
0    5  !
* 1     5"4  5"!
* 1   
    5"4 L!N!L!
* 1  3      
    2 
  .!L!
* : X      L  Q 
 
 C!SVY   
  -D"LN!
* : X      N 
 
  G   C!SVY!
* : X >-
  >7%74  "7 '-D"Z(!
* : X >-
  "- '<W" NSTV(!
* : X >-
  =- '<W" QLTL(!
* : X >-
  -X- '<W" NRRV(!
* 1   2        5:D L!R>L!S   5"4  !

©2005 OPENCAP - AHMED ALAMI • ALL RIGHTS RESERVED


3.1 Où TROUVER LES SPéCIFICATIONS? 12

3.1 Où trouver les spécifications?


......................................................................................................................................

SAML http://www.oasis-open.org/committees/security/
......................................................................................................................................
Security Services TC http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wss
......................................................................................................................................
WS-Federation http://www-106.ibm.com/developerworks/webservices/library/ws-fedworld/
......................................................................................................................................
WS-Security http://www.oasis-open.org/committees/tc_home.php?wg_abbrev=wss
......................................................................................................................................
WS-SecureConversation http://www-106.ibm.com/developerworks/webservices/library/ws-secon/
......................................................................................................................................
WS-SecurityPolicy http://www-106.ibm.com/developerworks/webservices/library/ws-secpol/
......................................................................................................................................
WS-Trust http://msdn.microsoft.com/library/en-us/dnglobspec/html/ws-trust.asp
......................................................................................................................................
XML-Encryption http://www.w3c.org/Encryption/2001/
......................................................................................................................................
XML-Signature http://www.w3c.org/Signature/

©2005 OPENCAP - AHMED ALAMI • ALL RIGHTS RESERVED

Vous aimerez peut-être aussi