Lines Matching refs:args

56 void Fingerprint(const FunctionCallbackInfo<Value>& args) {
57 Environment* env = Environment::GetCurrent(args);
59 ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder());
62 args.GetReturnValue().Set(ret);
173 void X509Certificate::Parse(const FunctionCallbackInfo<Value>& args) {
174 Environment* env = Environment::GetCurrent(args);
176 CHECK(args[0]->IsArrayBufferView());
177 ArrayBufferViewContents<unsigned char> buf(args[0].As<ArrayBufferView>());
182 BIOPointer bio(LoadBIO(env, args[0]));
204 args.GetReturnValue().Set(cert);
209 static void ReturnPropertyThroughBIO(const FunctionCallbackInfo<Value>& args) {
210 Environment* env = Environment::GetCurrent(args);
212 ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder());
217 args.GetReturnValue().Set(ret);
220 void X509Certificate::Subject(const FunctionCallbackInfo<Value>& args) {
221 ReturnPropertyThroughBIO<GetSubject>(args);
224 void X509Certificate::Issuer(const FunctionCallbackInfo<Value>& args) {
225 ReturnPropertyThroughBIO<GetIssuerString>(args);
228 void X509Certificate::SubjectAltName(const FunctionCallbackInfo<Value>& args) {
229 ReturnPropertyThroughBIO<GetSubjectAltNameString>(args);
232 void X509Certificate::InfoAccess(const FunctionCallbackInfo<Value>& args) {
233 ReturnPropertyThroughBIO<GetInfoAccessString>(args);
236 void X509Certificate::ValidFrom(const FunctionCallbackInfo<Value>& args) {
237 ReturnPropertyThroughBIO<GetValidFrom>(args);
240 void X509Certificate::ValidTo(const FunctionCallbackInfo<Value>& args) {
241 ReturnPropertyThroughBIO<GetValidTo>(args);
245 static void ReturnProperty(const FunctionCallbackInfo<Value>& args) {
246 Environment* env = Environment::GetCurrent(args);
248 ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder());
250 if (Property(env, cert->get()).ToLocal(&ret)) args.GetReturnValue().Set(ret);
253 void X509Certificate::KeyUsage(const FunctionCallbackInfo<Value>& args) {
254 ReturnProperty<GetKeyUsage>(args);
257 void X509Certificate::SerialNumber(const FunctionCallbackInfo<Value>& args) {
258 ReturnProperty<GetSerialNumber>(args);
261 void X509Certificate::Raw(const FunctionCallbackInfo<Value>& args) {
262 ReturnProperty<GetRawDERCertificate>(args);
265 void X509Certificate::PublicKey(const FunctionCallbackInfo<Value>& args) {
266 Environment* env = Environment::GetCurrent(args);
268 ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder());
281 args.GetReturnValue().Set(ret);
284 void X509Certificate::Pem(const FunctionCallbackInfo<Value>& args) {
285 Environment* env = Environment::GetCurrent(args);
287 ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder());
291 args.GetReturnValue().Set(ToV8Value(env, bio));
294 void X509Certificate::CheckCA(const FunctionCallbackInfo<Value>& args) {
297 ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder());
298 args.GetReturnValue().Set(X509_check_ca(cert->get()) == 1);
301 void X509Certificate::CheckHost(const FunctionCallbackInfo<Value>& args) {
302 Environment* env = Environment::GetCurrent(args);
304 ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder());
306 CHECK(args[0]->IsString()); // name
307 CHECK(args[1]->IsUint32()); // flags
309 Utf8Value name(env->isolate(), args[0]);
310 uint32_t flags = args[1].As<Uint32>()->Value();
320 Local<Value> ret = args[0];
325 return args.GetReturnValue().Set(ret);
336 void X509Certificate::CheckEmail(const FunctionCallbackInfo<Value>& args) {
337 Environment* env = Environment::GetCurrent(args);
339 ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder());
341 CHECK(args[0]->IsString()); // name
342 CHECK(args[1]->IsUint32()); // flags
344 Utf8Value name(env->isolate(), args[0]);
345 uint32_t flags = args[1].As<Uint32>()->Value();
353 return args.GetReturnValue().Set(args[0]);
363 void X509Certificate::CheckIP(const FunctionCallbackInfo<Value>& args) {
364 Environment* env = Environment::GetCurrent(args);
366 ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder());
368 CHECK(args[0]->IsString()); // IP
369 CHECK(args[1]->IsUint32()); // flags
371 Utf8Value name(env->isolate(), args[0]);
372 uint32_t flags = args[1].As<Uint32>()->Value();
376 return args.GetReturnValue().Set(args[0]);
386 void X509Certificate::CheckIssued(const FunctionCallbackInfo<Value>& args) {
387 Environment* env = Environment::GetCurrent(args);
389 ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder());
391 CHECK(args[0]->IsObject());
392 CHECK(X509Certificate::HasInstance(env, args[0].As<Object>()));
395 ASSIGN_OR_RETURN_UNWRAP(&issuer, args[0]);
399 args.GetReturnValue().Set(
403 void X509Certificate::CheckPrivateKey(const FunctionCallbackInfo<Value>& args) {
405 ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder());
407 CHECK(args[0]->IsObject());
409 ASSIGN_OR_RETURN_UNWRAP(&key, args[0]);
414 args.GetReturnValue().Set(
420 void X509Certificate::Verify(const FunctionCallbackInfo<Value>& args) {
422 ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder());
424 CHECK(args[0]->IsObject());
426 ASSIGN_OR_RETURN_UNWRAP(&key, args[0]);
431 args.GetReturnValue().Set(
437 void X509Certificate::ToLegacy(const FunctionCallbackInfo<Value>& args) {
438 Environment* env = Environment::GetCurrent(args);
440 ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder());
444 args.GetReturnValue().Set(ret);
447 void X509Certificate::GetIssuerCert(const FunctionCallbackInfo<Value>& args) {
449 ASSIGN_OR_RETURN_UNWRAP(&cert, args.Holder());
451 args.GetReturnValue().Set(cert->issuer_cert_->object());