pike.git / lib / modules / Standards.pmod / PKCS.pmod / testsuite.in

version» Context lines:

pike.git/lib/modules/Standards.pmod/PKCS.pmod/testsuite.in:1:   START_MARKER +  + test_do( add_constant("PKCS", Standards.PKCS) ) +    test_do([[    object r = Crypto.RSA(([    "n" : Gmp.mpz(172638464449001471794260856632944776452761322262794443556357951628647399941982332217330814054464677416598807575234720720862347748730033201660957860182434315264310811437207826303968624263889416989681358778289658174138674399061787845301799629100173916322305022090665681461036962656647167294833555103216138476839),    "e" : 65537,    "d" : Gmp.mpz(5597704151153213109583965093687652012788467732859883616236029223352849914959678593189007428868233814643216291520420244012275340129260121054206561986170756304878672379248981529837482899316892101306778257778878245041341720665878350668172975107605812430561649399015436350387099250448876360996383831325197960473),    "p" : Gmp.mpz(7705521142141601101742320592824105220616606686525158836897285298753429748335716690786703193825298274569072310528410658804617378333407731352245008918644317),    "q" : Gmp.mpz(22404515056722034723375314329429181298658560636168399365490841887482206312701236848950807727324312633362823872963829051417532601535030339846550649808662867),    ]));    add_constant("R", r);   ]])
pike.git/lib/modules/Standards.pmod/PKCS.pmod/testsuite.in:25:      test_eq( Standards.PKCS.RSA.build_public_key(R)->get_der(),   "0\201\237""0\r\6\t*\206H\206\367\r\1\1\1\5\0\3\201\215\0""0\201\211\2\201\201\0\365\330g\315mu-\376\347>$1\20\231\363\240\326\245\342\6\255\314\363\2\332\357\355E\0W\262\343\222\300\372a\6\bsTK\263\31\341\346\322\323\241\226\265""2@%\303\216\215\33""6g\215\326|\211\324\346Q\345C\274\212 X3\333+\4/\0s\276h\324\260\253\251VV\215J\22\341\247\354V\262k\6\205\27\243\223\24\23\262x\240\263\312\273\376\222\25\361Z\374Z\301\\\215;PT\2\312\322\300]'\2\3\1\0\1" )      test_eq( Standards.PKCS.RSA.signature_algorithm_id(Crypto.MD2)->get_der(),    "0\r\6\t*\206H\206\367\r\1\1\2\5\0" )   test_eq( Standards.PKCS.RSA.signature_algorithm_id(Crypto.MD5)->get_der(),    "0\r\6\t*\206H\206\367\r\1\1\4\5\0" )   test_eq( Standards.PKCS.RSA.signature_algorithm_id(Crypto.SHA1)->get_der(),    "0\r\6\t*\206H\206\367\r\1\1\5\5\0" ) + test_eq( Standards.PKCS.RSA.signature_algorithm_id(Crypto.SHA256)->get_der(), +  "0\r\6\t*\206H\206\367\r\1\1\v\5\0" ) + test_eq( Standards.PKCS.RSA.signature_algorithm_id(Crypto.SHA384)->get_der(), +  "0\r\6\t*\206H\206\367\r\1\1\f\5\0" ) + test_eq( Standards.PKCS.RSA.signature_algorithm_id(Crypto.SHA512)->get_der(), +  "0\r\6\t*\206H\206\367\r\1\1\r\5\0" )   test_eq( Standards.PKCS.RSA.signature_algorithm_id(Crypto.MD4), 0 )   test_eq( Standards.PKCS.DSA.signature_algorithm_id(Crypto.SHA1)->get_der(),    "0\t\6\a*\206H\316""8\4\3" ) -  + test_eq( Standards.PKCS.DSA.signature_algorithm_id(Crypto.SHA224)->get_der(), +  "0\v\6\t`\206H\1e\3\4\3\1" ) + test_eq( Standards.PKCS.DSA.signature_algorithm_id(Crypto.SHA256)->get_der(), +  "0\v\6\t`\206H\1e\3\4\3\2" )   test_eq( Standards.PKCS.DSA.signature_algorithm_id(Crypto.MD4), 0 )      test_do( add_constant("R"); )      test_true( Standards.PKCS.CSR )      test_true( Standards.PKCS.Certificate )   test_eq( Standards.PKCS.Certificate.build_distinguished_name( ([ "surname":"M", "commonName":"*" ]) )->get_der(), "0\30""1\n0\b\6\3U\4\3\23\1*1\n0\b\6\3U\4\4\23\1M")   test_eq( Standards.PKCS.Certificate.build_distinguished_name( ({ ([ "commonName":"*" ]), ([ "surname":"M" ]) }) )->get_der(), "0\30""1\n0\b\6\3U\4\3\23\1*1\n0\b\6\3U\4\4\23\1M")   test_eq( Standards.PKCS.Certificate.build_distinguished_name( ({ ([ "commonName":"*" ]), ([ "surname":Standards.ASN1.Types.PrintableString("M") ]) }) )->get_der(), "0\30""1\n0\b\6\3U\4\3\23\1*1\n0\b\6\3U\4\4\23\1M")      test_true( Standards.PKCS.DSA ) - test_true( Standards.PKCS.Identifiers ) +  + test_eq( sizeof(PKCS.Identifiers.name_ids), sizeof(PKCS.Identifiers.reverse_name_ids) ) + test_eq( sizeof(PKCS.Identifiers.attribute_ids), sizeof(PKCS.Identifiers.reverse_attribute_ids) ) + test_eq( sizeof(PKCS.Identifiers.at_ids), sizeof(PKCS.Identifiers.reverse_at_ids) ) + test_eq( sizeof(PKCS.Identifiers.ce_ids), sizeof(PKCS.Identifiers.reverse_ce_ids) ) + test_eq( sizeof(PKCS.Identifiers.kp_ids), sizeof(PKCS.Identifiers.reverse_kp_ids) ) + test_eq( sizeof(PKCS.Identifiers.ad_ids), sizeof(PKCS.Identifiers.reverse_ad_ids) ) +  + // Vector from RFC 3447 Appendix C. + test_eq( Standards.PKCS.Identifiers.pkcs_1_id->get_der(), +  String.hex2string("06 08 2A 86 48 86 F7 0D 01 01") ) +    test_true( Standards.PKCS.PFX )   test_true( Standards.PKCS.RSA ) -  +  + // Vector from RFC 3447 Appendix C. + test_eq( Standards.PKCS.RSA.pss_signature_algorithm_id(Crypto.SHA1)->get_der(), +  String.hex2string("30 0D 06 09 2A 86 48 86 F7 0D 01 01 0A 30 00") ) +    test_true( Standards.PKCS.Signature )    -  + test_false( Standards.PKCS.Signature.decode_signed("0\0z") ) +  + test_do( add_constant("PKCS") ) +    END_MARKER