File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -874,6 +874,24 @@ ossl_pkcs7_to_pem(VALUE self)
874
874
return str ;
875
875
}
876
876
877
+ static VALUE
878
+ ossl_pkcs7_finalize (VALUE self , VALUE data , VALUE flags )
879
+ {
880
+ PKCS7 * pkcs7 ;
881
+ BIO * in ;
882
+
883
+ GetPKCS7 (self , pkcs7 );
884
+
885
+ int flg = NIL_P (flags ) ? 0 : NUM2INT (flags );
886
+ in = ossl_obj2bio (& data );
887
+
888
+ if (!PKCS7_final (pkcs7 , in , flg )) {
889
+ ossl_raise (ePKCS7Error , NULL );
890
+ };
891
+
892
+ return self ;
893
+ }
894
+
877
895
/*
878
896
* SIGNER INFO
879
897
*/
@@ -1063,6 +1081,7 @@ Init_ossl_pkcs7(void)
1063
1081
rb_define_method (cPKCS7 , "to_pem" , ossl_pkcs7_to_pem , 0 );
1064
1082
rb_define_alias (cPKCS7 , "to_s" , "to_pem" );
1065
1083
rb_define_method (cPKCS7 , "to_der" , ossl_pkcs7_to_der , 0 );
1084
+ rb_define_method (cPKCS7 , "finalize" , ossl_pkcs7_finalize , 2 );
1066
1085
1067
1086
cPKCS7Signer = rb_define_class_under (cPKCS7 , "SignerInfo" , rb_cObject );
1068
1087
rb_define_const (cPKCS7 , "Signer" , cPKCS7Signer );
You can’t perform that action at this time.
0 commit comments