1- use rustls_cng:: store:: CertStore ;
1+ use rustls_cng:: store:: { CertStore , Pkcs12Flags } ;
22
33const PFX : & [ u8 ] = include_bytes ! ( "assets/rustls-ec.p12" ) ;
44const PASSWORD : & str = "changeit" ;
55
66#[ test]
77fn test_find_by_subject_str ( ) {
8- let store = CertStore :: from_pkcs12 ( PFX , PASSWORD ) . expect ( "Cannot open cert store" ) ;
8+ let store = CertStore :: from_pkcs12 ( PFX , PASSWORD , Pkcs12Flags :: default ( ) )
9+ . expect ( "Cannot open cert store" ) ;
910
1011 let context = store
1112 . find_by_subject_str ( "rustls" )
@@ -17,7 +18,8 @@ fn test_find_by_subject_str() {
1718
1819#[ test]
1920fn test_find_by_subject_name ( ) {
20- let store = CertStore :: from_pkcs12 ( PFX , PASSWORD ) . expect ( "Cannot open cert store" ) ;
21+ let store = CertStore :: from_pkcs12 ( PFX , PASSWORD , Pkcs12Flags :: default ( ) )
22+ . expect ( "Cannot open cert store" ) ;
2123
2224 let context = store
2325 . find_by_subject_name ( "CN=rustls-ec" )
@@ -29,7 +31,8 @@ fn test_find_by_subject_name() {
2931
3032#[ test]
3133fn test_find_by_issuer_str ( ) {
32- let store = CertStore :: from_pkcs12 ( PFX , PASSWORD ) . expect ( "Cannot open cert store" ) ;
34+ let store = CertStore :: from_pkcs12 ( PFX , PASSWORD , Pkcs12Flags :: default ( ) )
35+ . expect ( "Cannot open cert store" ) ;
3336
3437 let context = store
3538 . find_by_issuer_str ( "Inforce" )
@@ -41,7 +44,8 @@ fn test_find_by_issuer_str() {
4144
4245#[ test]
4346fn test_find_by_issuer_name ( ) {
44- let store = CertStore :: from_pkcs12 ( PFX , PASSWORD ) . expect ( "Cannot open cert store" ) ;
47+ let store = CertStore :: from_pkcs12 ( PFX , PASSWORD , Pkcs12Flags :: default ( ) )
48+ . expect ( "Cannot open cert store" ) ;
4549
4650 let context = store
4751 . find_by_issuer_name ( "O=Inforce Technologies, CN=Inforce Technologies CA" )
@@ -53,7 +57,8 @@ fn test_find_by_issuer_name() {
5357
5458#[ test]
5559fn test_find_by_hash ( ) {
56- let store = CertStore :: from_pkcs12 ( PFX , PASSWORD ) . expect ( "Cannot open cert store" ) ;
60+ let store = CertStore :: from_pkcs12 ( PFX , PASSWORD , Pkcs12Flags :: default ( ) )
61+ . expect ( "Cannot open cert store" ) ;
5762
5863 let sha1 = [
5964 0x66 , 0xBF , 0xFD , 0xE5 , 0xD2 , 0x9D , 0x57 , 0x97 , 0x1B , 0x17 , 0xBB , 0x81 , 0x5D , 0x7A , 0xF8 ,
@@ -65,7 +70,8 @@ fn test_find_by_hash() {
6570
6671#[ test]
6772fn test_find_by_hash256 ( ) {
68- let store = CertStore :: from_pkcs12 ( PFX , PASSWORD ) . expect ( "Cannot open cert store" ) ;
73+ let store = CertStore :: from_pkcs12 ( PFX , PASSWORD , Pkcs12Flags :: default ( ) )
74+ . expect ( "Cannot open cert store" ) ;
6975
7076 let sha256 = [
7177 0xC9 , 0x7C , 0xD6 , 0xA1 , 0x3F , 0xF6 , 0xBD , 0xF6 , 0xD4 , 0xE2 , 0xFB , 0x0E , 0xCD , 0x74 , 0x2F ,
@@ -79,7 +85,8 @@ fn test_find_by_hash256() {
7985
8086#[ test]
8187fn test_find_all ( ) {
82- let store = CertStore :: from_pkcs12 ( PFX , PASSWORD ) . expect ( "Cannot open cert store" ) ;
88+ let store = CertStore :: from_pkcs12 ( PFX , PASSWORD , Pkcs12Flags :: default ( ) )
89+ . expect ( "Cannot open cert store" ) ;
8390
8491 let context = store. find_all ( ) . unwrap ( ) . into_iter ( ) . next ( ) ;
8592 assert ! ( context. is_some( ) ) ;
0 commit comments