Lines Matching defs:args
241 void GetRootCertificates(const FunctionCallbackInfo<Value>& args) {
242 Environment* env = Environment::GetCurrent(args);
254 args.GetReturnValue().Set(
419 void SecureContext::New(const FunctionCallbackInfo<Value>& args) {
420 Environment* env = Environment::GetCurrent(args);
421 new SecureContext(env, args.This());
424 void SecureContext::Init(const FunctionCallbackInfo<Value>& args) {
426 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
429 CHECK_EQ(args.Length(), 3);
430 CHECK(args[1]->IsInt32());
431 CHECK(args[2]->IsInt32());
433 int min_version = args[1].As<Int32>()->Value();
434 int max_version = args[2].As<Int32>()->Value();
440 if (args[0]->IsString()) {
441 Utf8Value sslmethod(env->isolate(), args[0]);
595 void SecureContext::SetKey(const FunctionCallbackInfo<Value>& args) {
596 Environment* env = Environment::GetCurrent(args);
599 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
601 CHECK_GE(args.Length(), 1); // Private key argument is mandatory
603 BIOPointer bio(LoadBIO(env, args[0]));
608 if (args[1]->IsString())
609 passphrase = ByteSource::FromString(env, args[1].As<String>());
628 void SecureContext::SetSigalgs(const FunctionCallbackInfo<Value>& args) {
630 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
634 CHECK_EQ(args.Length(), 1);
635 CHECK(args[0]->IsString());
637 const Utf8Value sigalgs(env->isolate(), args[0]);
644 void SecureContext::SetEngineKey(const FunctionCallbackInfo<Value>& args) {
645 Environment* env = Environment::GetCurrent(args);
648 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
650 CHECK_EQ(args.Length(), 2);
653 Utf8Value engine_id(env->isolate(), args[1]);
669 Utf8Value key_name(env->isolate(), args[0]);
700 void SecureContext::SetCert(const FunctionCallbackInfo<Value>& args) {
701 Environment* env = Environment::GetCurrent(args);
704 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
706 CHECK_GE(args.Length(), 1); // Certificate argument is mandatory
708 BIOPointer bio(LoadBIO(env, args[0]));
727 void SecureContext::AddCACert(const FunctionCallbackInfo<Value>& args) {
728 Environment* env = Environment::GetCurrent(args);
731 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
733 CHECK_GE(args.Length(), 1); // CA certificate argument is mandatory
735 BIOPointer bio(LoadBIO(env, args[0]));
764 void SecureContext::AddCRL(const FunctionCallbackInfo<Value>& args) {
765 Environment* env = Environment::GetCurrent(args);
768 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
770 CHECK_GE(args.Length(), 1); // CRL argument is mandatory
772 BIOPointer bio(LoadBIO(env, args[0]));
785 void SecureContext::AddRootCerts(const FunctionCallbackInfo<Value>& args) {
787 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
791 void SecureContext::SetCipherSuites(const FunctionCallbackInfo<Value>& args) {
795 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
799 CHECK_EQ(args.Length(), 1);
800 CHECK(args[0]->IsString());
802 const Utf8Value ciphers(env->isolate(), args[0]);
808 void SecureContext::SetCiphers(const FunctionCallbackInfo<Value>& args) {
810 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
814 CHECK_EQ(args.Length(), 1);
815 CHECK(args[0]->IsString());
817 Utf8Value ciphers(env->isolate(), args[0]);
832 void SecureContext::SetECDHCurve(const FunctionCallbackInfo<Value>& args) {
834 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
837 CHECK_GE(args.Length(), 1); // ECDH curve name argument is mandatory
838 CHECK(args[0]->IsString());
840 Utf8Value curve(env->isolate(), args[0]);
847 void SecureContext::SetDHParam(const FunctionCallbackInfo<Value>& args) {
849 ASSIGN_OR_RETURN_UNWRAP(&sc, args.This());
853 CHECK_GE(args.Length(), 1); // DH argument is mandatory
858 if (args[0]->IsTrue()) {
865 BIOPointer bio(LoadBIO(env, args[0]));
884 args.GetReturnValue().Set(FIXED_ONE_BYTE_STRING(
894 void SecureContext::SetMinProto(const FunctionCallbackInfo<Value>& args) {
896 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
898 CHECK_EQ(args.Length(), 1);
899 CHECK(args[0]->IsInt32());
901 int version = args[0].As<Int32>()->Value();
906 void SecureContext::SetMaxProto(const FunctionCallbackInfo<Value>& args) {
908 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
910 CHECK_EQ(args.Length(), 1);
911 CHECK(args[0]->IsInt32());
913 int version = args[0].As<Int32>()->Value();
918 void SecureContext::GetMinProto(const FunctionCallbackInfo<Value>& args) {
920 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
922 CHECK_EQ(args.Length(), 0);
926 args.GetReturnValue().Set(static_cast<uint32_t>(version));
929 void SecureContext::GetMaxProto(const FunctionCallbackInfo<Value>& args) {
931 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
933 CHECK_EQ(args.Length(), 0);
937 args.GetReturnValue().Set(static_cast<uint32_t>(version));
940 void SecureContext::SetOptions(const FunctionCallbackInfo<Value>& args) {
941 Environment* env = Environment::GetCurrent(args);
943 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
945 CHECK_GE(args.Length(), 1);
946 CHECK(args[0]->IsNumber());
948 int64_t val = args[0]->IntegerValue(env->context()).FromMaybe(0);
955 const FunctionCallbackInfo<Value>& args) {
957 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
960 CHECK_GE(args.Length(), 1);
961 CHECK(args[0]->IsString());
963 const Utf8Value sessionIdContext(env->isolate(), args[0]);
987 void SecureContext::SetSessionTimeout(const FunctionCallbackInfo<Value>& args) {
989 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
991 CHECK_GE(args.Length(), 1);
992 CHECK(args[0]->IsInt32());
994 int32_t sessionTimeout = args[0].As<Int32>()->Value();
998 void SecureContext::Close(const FunctionCallbackInfo<Value>& args) {
1000 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
1005 void SecureContext::LoadPKCS12(const FunctionCallbackInfo<Value>& args) {
1006 Environment* env = Environment::GetCurrent(args);
1012 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
1015 if (args.Length() < 1) {
1019 BIOPointer in(LoadBIO(env, args[0]));
1025 if (args.Length() >= 2) {
1026 THROW_AND_RETURN_IF_NOT_BUFFER(env, args[1], "Pass phrase");
1027 Local<ArrayBufferView> abv = args[1].As<ArrayBufferView>();
1089 const FunctionCallbackInfo<Value>& args) {
1090 Environment* env = Environment::GetCurrent(args);
1091 CHECK_EQ(args.Length(), 1);
1092 CHECK(args[0]->IsString());
1095 ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
1107 const Utf8Value engine_id(env->isolate(), args[0]);
1123 void SecureContext::GetTicketKeys(const FunctionCallbackInfo<Value>& args) {
1125 ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
1135 args.GetReturnValue().Set(buff);
1138 void SecureContext::SetTicketKeys(const FunctionCallbackInfo<Value>& args) {
1140 ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
1142 CHECK_GE(args.Length(), 1); // Ticket keys argument is mandatory
1143 CHECK(args[0]->IsArrayBufferView());
1144 ArrayBufferViewContents<char> buf(args[0].As<ArrayBufferView>());
1152 args.GetReturnValue().Set(true);
1158 const FunctionCallbackInfo<Value>& args) {
1160 ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
1312 void SecureContext::GetCertificate(const FunctionCallbackInfo<Value>& args) {
1314 ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder());
1323 return args.GetReturnValue().SetNull();
1333 args.GetReturnValue().Set(buff);
1382 const FunctionCallbackInfo<Value>& args) {
1383 return args.GetReturnValue().Set(extra_root_certs_loaded);