aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/webcrypto/CryptoKeyRSA.cpp
diff options
context:
space:
mode:
authorGravatar Dylan Conway <dylan.conway567@gmail.com> 2023-10-10 15:28:08 -0700
committerGravatar Dylan Conway <dylan.conway567@gmail.com> 2023-10-10 15:28:08 -0700
commitee2e34866e3bc0d12ba5cb1d5041524776472d71 (patch)
tree3f71bf8153545396ba38294f8577e77ce0b12439 /src/bun.js/bindings/webcrypto/CryptoKeyRSA.cpp
parente6d97f2581959d77a5b486faefbfdf094abedf9b (diff)
parent6301778a589254e2c3c0d95f768fce303f528b03 (diff)
downloadbun-ee2e34866e3bc0d12ba5cb1d5041524776472d71.tar.gz
bun-ee2e34866e3bc0d12ba5cb1d5041524776472d71.tar.zst
bun-ee2e34866e3bc0d12ba5cb1d5041524776472d71.zip
Merge branch 'main' into dylan/github-api-option
Diffstat (limited to 'src/bun.js/bindings/webcrypto/CryptoKeyRSA.cpp')
-rw-r--r--src/bun.js/bindings/webcrypto/CryptoKeyRSA.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyRSA.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyRSA.cpp
index 273218721..859767107 100644
--- a/src/bun.js/bindings/webcrypto/CryptoKeyRSA.cpp
+++ b/src/bun.js/bindings/webcrypto/CryptoKeyRSA.cpp
@@ -28,6 +28,7 @@
#include "CryptoKeyRSAComponents.h"
#include "JsonWebKey.h"
+#include "../wtf-bindings.h"
#include <wtf/text/Base64.h>
#if ENABLE(WEB_CRYPTO)
@@ -143,30 +144,30 @@ JsonWebKey CryptoKeyRSA::exportJwk() const
return result;
// public key
- result.n = base64URLEncodeToString(rsaComponents->modulus());
- result.e = base64URLEncodeToString(rsaComponents->exponent());
+ result.n = Bun::base64URLEncodeToString(rsaComponents->modulus());
+ result.e = Bun::base64URLEncodeToString(rsaComponents->exponent());
if (rsaComponents->type() == CryptoKeyRSAComponents::Type::Public)
return result;
// private key
- result.d = base64URLEncodeToString(rsaComponents->privateExponent());
+ result.d = Bun::base64URLEncodeToString(rsaComponents->privateExponent());
if (!rsaComponents->hasAdditionalPrivateKeyParameters())
return result;
- result.p = base64URLEncodeToString(rsaComponents->firstPrimeInfo().primeFactor);
- result.q = base64URLEncodeToString(rsaComponents->secondPrimeInfo().primeFactor);
- result.dp = base64URLEncodeToString(rsaComponents->firstPrimeInfo().factorCRTExponent);
- result.dq = base64URLEncodeToString(rsaComponents->secondPrimeInfo().factorCRTExponent);
- result.qi = base64URLEncodeToString(rsaComponents->secondPrimeInfo().factorCRTCoefficient);
+ result.p = Bun::base64URLEncodeToString(rsaComponents->firstPrimeInfo().primeFactor);
+ result.q = Bun::base64URLEncodeToString(rsaComponents->secondPrimeInfo().primeFactor);
+ result.dp = Bun::base64URLEncodeToString(rsaComponents->firstPrimeInfo().factorCRTExponent);
+ result.dq = Bun::base64URLEncodeToString(rsaComponents->secondPrimeInfo().factorCRTExponent);
+ result.qi = Bun::base64URLEncodeToString(rsaComponents->secondPrimeInfo().factorCRTCoefficient);
if (rsaComponents->otherPrimeInfos().isEmpty())
return result;
Vector<RsaOtherPrimesInfo> oth;
for (const auto& info : rsaComponents->otherPrimeInfos()) {
RsaOtherPrimesInfo otherInfo;
- otherInfo.r = base64URLEncodeToString(info.primeFactor);
- otherInfo.d = base64URLEncodeToString(info.factorCRTExponent);
- otherInfo.t = base64URLEncodeToString(info.factorCRTCoefficient);
+ otherInfo.r = Bun::base64URLEncodeToString(info.primeFactor);
+ otherInfo.d = Bun::base64URLEncodeToString(info.factorCRTExponent);
+ otherInfo.t = Bun::base64URLEncodeToString(info.factorCRTCoefficient);
oth.append(WTFMove(otherInfo));
}
result.oth = WTFMove(oth);