Class: OpenSSL::PKCS7::SignerInfo
- Inherits:
-
Object
- Object
- OpenSSL::PKCS7::SignerInfo
- Defined in:
- ext/openssl/ossl_pkcs7.c
Instance Method Summary collapse
- #initialize(cert, key, digest) ⇒ Object constructor
- #issuer ⇒ Object
- #serial ⇒ Object
- #signed_time ⇒ Object
Constructor Details
#initialize(cert, key, digest) ⇒ Object
969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 |
# File 'ext/openssl/ossl_pkcs7.c', line 969 static VALUE ossl_pkcs7si_initialize(VALUE self, VALUE cert, VALUE key, VALUE digest) { PKCS7_SIGNER_INFO *p7si; EVP_PKEY *pkey; X509 *x509; const EVP_MD *md; VALUE md_holder; pkey = GetPrivPKeyPtr(key); /* NO NEED TO DUP */ x509 = GetX509CertPtr(cert); /* NO NEED TO DUP */ md = ossl_evp_md_fetch(digest, &md_holder); GetPKCS7si(self, p7si); if (!(PKCS7_SIGNER_INFO_set(p7si, x509, pkey, md))) ossl_raise(ePKCS7Error, "PKCS7_SIGNER_INFO_set"); rb_ivar_set(self, id_md_holder, md_holder); return self; } |
Instance Method Details
#issuer ⇒ Object
989 990 991 992 993 994 995 996 997 |
# File 'ext/openssl/ossl_pkcs7.c', line 989 static VALUE ossl_pkcs7si_get_issuer(VALUE self) { PKCS7_SIGNER_INFO *p7si; GetPKCS7si(self, p7si); return ossl_x509name_new(p7si->issuer_and_serial->issuer); } |
#serial ⇒ Object
999 1000 1001 1002 1003 1004 1005 1006 1007 |
# File 'ext/openssl/ossl_pkcs7.c', line 999 static VALUE ossl_pkcs7si_get_serial(VALUE self) { PKCS7_SIGNER_INFO *p7si; GetPKCS7si(self, p7si); return asn1integer_to_num(p7si->issuer_and_serial->serial); } |
#signed_time ⇒ Object
1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 |
# File 'ext/openssl/ossl_pkcs7.c', line 1009 static VALUE ossl_pkcs7si_get_signed_time(VALUE self) { PKCS7_SIGNER_INFO *p7si; const ASN1_TYPE *asn1obj; GetPKCS7si(self, p7si); if (!(asn1obj = PKCS7_get_signed_attribute(p7si, NID_pkcs9_signingTime))) { ossl_raise(ePKCS7Error, NULL); } if (asn1obj->type == V_ASN1_UTCTIME) { return asn1time_to_time(asn1obj->value.utctime); } /* * OR * ossl_raise(ePKCS7Error, "..."); * ? */ return Qnil; } |