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

公開メンバ関数

RawAuthenticateResponse parseRawAuthenticateResponse (String rawDataBase64)
 
void checkSignature (String appId, ClientData clientData, RawAuthenticateResponse rawAuthenticateResponse, byte[] publicKey) throws BadInputException
 

静的公開変数類

static final String AUTHENTICATE_GET_TYPE = "navigator.id.getAssertion"
 
static final String AUTHENTICATE_CANCEL_TYPE = "navigator.id.cancelAssertion"
 
static final String [] SUPPORTED_AUTHENTICATE_TYPES = new String[] { AUTHENTICATE_GET_TYPE, AUTHENTICATE_CANCEL_TYPE }
 

非公開メンバ関数

byte [] packBytesToSign (byte[] appIdHash, byte userPresence, long counter, byte[] challengeHash)
 

非公開変数類

Logger log
 
SHA256withECDSASignatureVerification signatureVerification
 

詳解

Provides operations with U2F RAW authentication response

著者
Yuriy Movchan Date: 05/20/2015

関数詳解

◆ checkSignature()

void org.xdi.oxauth.service.fido.u2f.RawAuthenticationService.checkSignature ( String  appId,
ClientData  clientData,
RawAuthenticateResponse  rawAuthenticateResponse,
byte []  publicKey 
) throws BadInputException
inline
58  {
59  String rawClientData = clientData.getRawClientData();
60 
61  byte[] signedBytes = packBytesToSign(signatureVerification.hash(appId), rawAuthenticateResponse.getUserPresence(),
62  rawAuthenticateResponse.getCounter(), signatureVerification.hash(rawClientData));
63  try {
64  signatureVerification.checkSignature(signatureVerification.decodePublicKey(publicKey), signedBytes, rawAuthenticateResponse.getSignature());
65  } catch (SignatureException ex) {
66  throw new BadInputException("Failed to checkSignature", ex);
67  }
68  }
byte [] hash(byte[] bytes)
Definition: SHA256withECDSASignatureVerification.java:72
boolean checkSignature(X509Certificate certificate, byte[] signedBytes, byte[] signature)
Definition: SHA256withECDSASignatureVerification.java:30
PublicKey decodePublicKey(byte[] encodedPublicKey)
Definition: SHA256withECDSASignatureVerification.java:51
byte [] packBytesToSign(byte[] appIdHash, byte userPresence, long counter, byte[] challengeHash)
Definition: RawAuthenticationService.java:70
SHA256withECDSASignatureVerification signatureVerification
Definition: RawAuthenticationService.java:45

◆ packBytesToSign()

byte [] org.xdi.oxauth.service.fido.u2f.RawAuthenticationService.packBytesToSign ( byte []  appIdHash,
byte  userPresence,
long  counter,
byte []  challengeHash 
)
inlineprivate
70  {
71  ByteArrayDataOutput encoded = ByteStreams.newDataOutput();
72  encoded.write(appIdHash);
73  encoded.write(userPresence);
74  encoded.writeInt((int) counter);
75  encoded.write(challengeHash);
76 
77  return encoded.toByteArray();
78  }

◆ parseRawAuthenticateResponse()

RawAuthenticateResponse org.xdi.oxauth.service.fido.u2f.RawAuthenticationService.parseRawAuthenticateResponse ( String  rawDataBase64)
inline
47  {
48  ByteDataInputStream bis = new ByteDataInputStream(Base64Util.base64urldecode(rawDataBase64));
49  try {
50  return new RawAuthenticateResponse(bis.readSigned(), bis.readInt(), bis.readAll());
51  } catch (IOException ex) {
52  throw new BadInputException("Failed to parse RAW authenticate response", ex);
53  } finally {
54  IOUtils.closeQuietly(bis);
55  }
56  }

メンバ詳解

◆ AUTHENTICATE_CANCEL_TYPE

final String org.xdi.oxauth.service.fido.u2f.RawAuthenticationService.AUTHENTICATE_CANCEL_TYPE = "navigator.id.cancelAssertion"
static

◆ AUTHENTICATE_GET_TYPE

final String org.xdi.oxauth.service.fido.u2f.RawAuthenticationService.AUTHENTICATE_GET_TYPE = "navigator.id.getAssertion"
static

◆ log

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

◆ signatureVerification

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

◆ SUPPORTED_AUTHENTICATE_TYPES

final String [] org.xdi.oxauth.service.fido.u2f.RawAuthenticationService.SUPPORTED_AUTHENTICATE_TYPES = new String[] { AUTHENTICATE_GET_TYPE, AUTHENTICATE_CANCEL_TYPE }
static

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