gluu
公開メンバ関数 | 静的公開変数類 | 非公開メンバ関数 | 非公開変数類 | 全メンバ一覧
org.xdi.oxauth.service.fido.u2f.RawRegistrationService クラス
org.xdi.oxauth.service.fido.u2f.RawRegistrationService 連携図
Collaboration graph

公開メンバ関数

RawRegisterResponse parseRawRegisterResponse (String rawDataBase64) throws BadInputException
 
void checkSignature (String appId, ClientData clientData, RawRegisterResponse rawRegisterResponse) throws BadInputException
 
DeviceRegistration createDevice (RawRegisterResponse rawRegisterResponse) throws BadInputException
 

静的公開変数類

static final byte REGISTRATION_RESERVED_BYTE_VALUE = (byte) 0x05
 
static final byte REGISTRATION_SIGNED_RESERVED_BYTE_VALUE = (byte) 0x00
 
static final long INITIAL_DEVICE_COUNTER_VALUE = -1
 
static final String REGISTER_FINISH_TYPE = "navigator.id.finishEnrollment"
 
static final String REGISTER_CANCEL_TYPE = "navigator.id.cancelEnrollment"
 
static final String [] SUPPORTED_REGISTER_TYPES = new String[] { REGISTER_FINISH_TYPE, REGISTER_CANCEL_TYPE }
 

非公開メンバ関数

byte [] packBytesToSign (byte[] appIdHash, byte[] clientDataHash, byte[] keyHandle, byte[] userPublicKey)
 

非公開変数類

Logger log
 
SHA256withECDSASignatureVerification signatureVerification
 

詳解

Provides operations with U2F RAW registration response

著者
Yuriy Movchan Date: 05/20/2015

関数詳解

◆ checkSignature()

void org.xdi.oxauth.service.fido.u2f.RawRegistrationService.checkSignature ( String  appId,
ClientData  clientData,
RawRegisterResponse  rawRegisterResponse 
) throws BadInputException
inline
74  {
75  String rawClientData = clientData.getRawClientData();
76  byte[] signedBytes = packBytesToSign(signatureVerification.hash(appId), signatureVerification.hash(rawClientData), rawRegisterResponse.getKeyHandle(),
77  rawRegisterResponse.getUserPublicKey());
78  try {
79  signatureVerification.checkSignature(rawRegisterResponse.getAttestationCertificate(), signedBytes, rawRegisterResponse.getSignature());
80  } catch (SignatureException ex) {
81  throw new BadInputException("Failed to checkSignature", ex);
82  }
83  }
byte [] packBytesToSign(byte[] appIdHash, byte[] clientDataHash, byte[] keyHandle, byte[] userPublicKey)
Definition: RawRegistrationService.java:85
byte [] hash(byte[] bytes)
Definition: SHA256withECDSASignatureVerification.java:72
boolean checkSignature(X509Certificate certificate, byte[] signedBytes, byte[] signature)
Definition: SHA256withECDSASignatureVerification.java:30
SHA256withECDSASignatureVerification signatureVerification
Definition: RawRegistrationService.java:53

◆ createDevice()

DeviceRegistration org.xdi.oxauth.service.fido.u2f.RawRegistrationService.createDevice ( RawRegisterResponse  rawRegisterResponse) throws BadInputException
inline
96  {
97  return new DeviceRegistration(Base64Util.base64urlencode(rawRegisterResponse.getKeyHandle()), Base64Util.base64urlencode(rawRegisterResponse
98  .getUserPublicKey()), rawRegisterResponse.getAttestationCertificate(), INITIAL_DEVICE_COUNTER_VALUE);
99  }
static final long INITIAL_DEVICE_COUNTER_VALUE
Definition: RawRegistrationService.java:45

◆ packBytesToSign()

byte [] org.xdi.oxauth.service.fido.u2f.RawRegistrationService.packBytesToSign ( byte []  appIdHash,
byte []  clientDataHash,
byte []  keyHandle,
byte []  userPublicKey 
)
inlineprivate
85  {
86  ByteArrayDataOutput encoded = ByteStreams.newDataOutput();
88  encoded.write(appIdHash);
89  encoded.write(clientDataHash);
90  encoded.write(keyHandle);
91  encoded.write(userPublicKey);
92 
93  return encoded.toByteArray();
94  }
static final byte REGISTRATION_SIGNED_RESERVED_BYTE_VALUE
Definition: RawRegistrationService.java:44

◆ parseRawRegisterResponse()

RawRegisterResponse org.xdi.oxauth.service.fido.u2f.RawRegistrationService.parseRawRegisterResponse ( String  rawDataBase64) throws BadInputException
inline
55  {
56  ByteDataInputStream bis = new ByteDataInputStream(Base64Util.base64urldecode(rawDataBase64));
57  try {
58  try {
59  byte reservedByte = bis.readSigned();
60  if (reservedByte != REGISTRATION_RESERVED_BYTE_VALUE) {
61  throw new BadInputException("Incorrect value of reserved byte. Expected: " + REGISTRATION_RESERVED_BYTE_VALUE + ". Was: " + reservedByte);
62  }
63  return new RawRegisterResponse(bis.read(65), bis.read(bis.readUnsigned()), CertificateParser.parseDer(bis), bis.readAll());
64  } catch (IOException ex) {
65  throw new BadInputException("Failed to parse RAW register response", ex);
66  } catch (CertificateException e) {
67  throw new BadInputException("Malformed attestation certificate", e);
68  }
69  } finally {
70  IOUtils.closeQuietly(bis);
71  }
72  }
static final byte REGISTRATION_RESERVED_BYTE_VALUE
Definition: RawRegistrationService.java:43

メンバ詳解

◆ INITIAL_DEVICE_COUNTER_VALUE

final long org.xdi.oxauth.service.fido.u2f.RawRegistrationService.INITIAL_DEVICE_COUNTER_VALUE = -1
static

◆ log

Logger org.xdi.oxauth.service.fido.u2f.RawRegistrationService.log
private

◆ REGISTER_CANCEL_TYPE

final String org.xdi.oxauth.service.fido.u2f.RawRegistrationService.REGISTER_CANCEL_TYPE = "navigator.id.cancelEnrollment"
static

◆ REGISTER_FINISH_TYPE

final String org.xdi.oxauth.service.fido.u2f.RawRegistrationService.REGISTER_FINISH_TYPE = "navigator.id.finishEnrollment"
static

◆ REGISTRATION_RESERVED_BYTE_VALUE

final byte org.xdi.oxauth.service.fido.u2f.RawRegistrationService.REGISTRATION_RESERVED_BYTE_VALUE = (byte) 0x05
static

◆ REGISTRATION_SIGNED_RESERVED_BYTE_VALUE

final byte org.xdi.oxauth.service.fido.u2f.RawRegistrationService.REGISTRATION_SIGNED_RESERVED_BYTE_VALUE = (byte) 0x00
static

◆ signatureVerification

SHA256withECDSASignatureVerification org.xdi.oxauth.service.fido.u2f.RawRegistrationService.signatureVerification
private

◆ SUPPORTED_REGISTER_TYPES

final String [] org.xdi.oxauth.service.fido.u2f.RawRegistrationService.SUPPORTED_REGISTER_TYPES = new String[] { REGISTER_FINISH_TYPE, REGISTER_CANCEL_TYPE }
static

このクラス詳解は次のファイルから抽出されました: