File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
tests/unit/Yubico/YubiKey/Fido2 Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 16
16
using System . Collections . Generic ;
17
17
using System . Formats . Cbor ;
18
18
using System . Globalization ;
19
- using System . Security . Cryptography ;
20
19
using System . Security . Cryptography . X509Certificates ;
21
20
using Yubico . YubiKey . Cryptography ;
22
21
using Yubico . YubiKey . Fido2 . Cbor ;
@@ -167,6 +166,8 @@ public class MakeCredentialData
167
166
/// </summary>
168
167
public ReadOnlyMemory < byte > ? LargeBlobKey { get ; private set ; }
169
168
169
+ public ReadOnlyMemory < byte > RawData { get ; private set ; }
170
+
170
171
// The default constructor explicitly defined. We don't want it to be
171
172
// used.
172
173
private MakeCredentialData ( )
@@ -193,10 +194,13 @@ private MakeCredentialData()
193
194
/// </exception>
194
195
public MakeCredentialData ( ReadOnlyMemory < byte > cborEncoding )
195
196
{
197
+ var map = new CborMap < int > ( cborEncoding ) ;
198
+ byte [ ] rawData = new byte [ cborEncoding . Length ] ;
199
+ cborEncoding . CopyTo ( rawData ) ;
200
+ RawData = rawData ;
201
+
196
202
try
197
203
{
198
- var map = new CborMap < int > ( cborEncoding ) ;
199
-
200
204
Format = map . ReadTextString ( KeyFormat ) ;
201
205
AuthenticatorData = new AuthenticatorData ( map . ReadByteString ( KeyAuthData ) ) ;
202
206
if ( ! ( AuthenticatorData . CredentialPublicKey is CoseEcPublicKey )
Original file line number Diff line number Diff line change @@ -18,6 +18,15 @@ namespace Yubico.YubiKey.Fido2
18
18
{
19
19
public class CredentialDataTests
20
20
{
21
+ [ Fact ]
22
+ public void RawData_Is_Set ( )
23
+ {
24
+ byte [ ] encoding = GetSampleEncoding ( ) ;
25
+ var cData = new MakeCredentialData ( encoding ) ;
26
+ Assert . Equal ( encoding , cData . RawData ) ;
27
+ }
28
+
29
+
21
30
[ Fact ]
22
31
public void Decode_Format_Correct ( )
23
32
{
You can’t perform that action at this time.
0 commit comments