@@ -68,6 +68,7 @@ Local<FunctionTemplate> X509Certificate::GetConstructorTemplate(
68
68
env->SetProtoMethod (tmpl, " validFrom" , ValidFrom);
69
69
env->SetProtoMethod (tmpl, " fingerprint" , Fingerprint);
70
70
env->SetProtoMethod (tmpl, " fingerprint256" , Fingerprint256);
71
+ env->SetProtoMethod (tmpl, " fingerprint512" , Fingerprint512);
71
72
env->SetProtoMethod (tmpl, " keyUsage" , KeyUsage);
72
73
env->SetProtoMethod (tmpl, " serialNumber" , SerialNumber);
73
74
env->SetProtoMethod (tmpl, " pem" , Pem);
@@ -268,6 +269,15 @@ void X509Certificate::Fingerprint256(const FunctionCallbackInfo<Value>& args) {
268
269
args.GetReturnValue ().Set (ret);
269
270
}
270
271
272
+ void X509Certificate::Fingerprint512 (const FunctionCallbackInfo<Value>& args) {
273
+ Environment* env = Environment::GetCurrent (args);
274
+ X509Certificate* cert;
275
+ ASSIGN_OR_RETURN_UNWRAP (&cert, args.Holder ());
276
+ Local<Value> ret;
277
+ if (GetFingerprintDigest (env, EVP_sha512 (), cert->get ()).ToLocal (&ret))
278
+ args.GetReturnValue ().Set (ret);
279
+ }
280
+
271
281
void X509Certificate::KeyUsage (const FunctionCallbackInfo<Value>& args) {
272
282
Environment* env = Environment::GetCurrent (args);
273
283
X509Certificate* cert;
0 commit comments