Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
* License, v. 2.0. If a copy of the MPL was not distributed with this
5
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef mozilla_dom_AuthenticatorAssertionResponse_h
8
#define mozilla_dom_AuthenticatorAssertionResponse_h
9
10
#include "js/TypeDecls.h"
11
#include "mozilla/Attributes.h"
12
#include "mozilla/ErrorResult.h"
13
#include "mozilla/dom/AuthenticatorResponse.h"
14
#include "mozilla/dom/BindingDeclarations.h"
15
#include "mozilla/dom/CryptoBuffer.h"
16
#include "nsCycleCollectionParticipant.h"
17
#include "nsWrapperCache.h"
18
19
namespace mozilla {
20
namespace dom {
21
22
class AuthenticatorAssertionResponse final : public AuthenticatorResponse {
23
public:
24
NS_DECL_ISUPPORTS_INHERITED
25
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(
26
AuthenticatorAssertionResponse, AuthenticatorResponse)
27
28
explicit AuthenticatorAssertionResponse(nsPIDOMWindowInner* aParent);
29
30
protected:
31
~AuthenticatorAssertionResponse() override;
32
33
public:
34
virtual JSObject* WrapObject(JSContext* aCx,
35
JS::Handle<JSObject*> aGivenProto) override;
36
37
void GetAuthenticatorData(JSContext* aCx,
38
JS::MutableHandle<JSObject*> aRetVal);
39
40
nsresult SetAuthenticatorData(CryptoBuffer& aBuffer);
41
42
void GetSignature(JSContext* aCx, JS::MutableHandle<JSObject*> aRetVal);
43
44
nsresult SetSignature(CryptoBuffer& aBuffer);
45
46
void GetUserHandle(JSContext* aCx, JS::MutableHandle<JSObject*> aRetVal);
47
48
nsresult SetUserHandle(CryptoBuffer& aUserHandle);
49
50
private:
51
CryptoBuffer mAuthenticatorData;
52
JS::Heap<JSObject*> mAuthenticatorDataCachedObj;
53
CryptoBuffer mSignature;
54
JS::Heap<JSObject*> mSignatureCachedObj;
55
CryptoBuffer mUserHandle;
56
JS::Heap<JSObject*> mUserHandleCachedObj;
57
};
58
59
} // namespace dom
60
} // namespace mozilla
61
62
#endif // mozilla_dom_AuthenticatorAssertionResponse_h