SignedHttpRequest class
方法
| generate |
為給定的請求選項產生並快取一對金鑰對。 |
| remove |
移除瀏覽器中給定公鑰指紋的快取金鑰 |
| sign |
以指定金鑰為該有效載荷產生簽署的 HTTP 請求。 |
建構函式詳細資料
SignedHttpRequest(SignedHttpRequestParameters, SignedHttpRequestOptions)
new SignedHttpRequest(shrParameters: SignedHttpRequestParameters, shrOptions?: SignedHttpRequestOptions)
參數
- shrParameters
- SignedHttpRequestParameters
- shrOptions
- SignedHttpRequestOptions
方法詳細資料
generatePublicKeyThumbprint()
為給定的請求選項產生並快取一對金鑰對。
function generatePublicKeyThumbprint(): Promise<string>
傳回
Promise<string>
公鑰摘要,應該會送給代幣發行者。
removeKeys(string)
移除瀏覽器中給定公鑰指紋的快取金鑰
function removeKeys(publicKeyThumbprint: string): Promise<boolean>
參數
- publicKeyThumbprint
-
string
公開金鑰摘要(來自 generatePublicKeyThumbprint API)
傳回
Promise<boolean>
如果金鑰被正確刪除
signRequest(string, string, object)
以指定金鑰為該有效載荷產生簽署的 HTTP 請求。
function signRequest(payload: string, publicKeyThumbprint: string, claims?: object): Promise<string>
參數
- payload
-
string
要簽署的有效載荷(例如存取權杖)
- publicKeyThumbprint
-
string
公開金鑰摘要(來自 generatePublicKeyThumbprint API)
- claims
-
object
在簽署的JWT中包含或覆蓋的額外權利要求
傳回
Promise<string>
Pop 代幣以對應的私鑰簽署