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

静的公開メンバ関数

static String getPublicKeySshFingerprint (PublicKey publicKey) throws NoSuchAlgorithmException, IOException
 
static String getPublicKeySshFingerprint (RSAPublicKey publicKey) throws NoSuchAlgorithmException, IOException
 

静的非公開メンバ関数

static byte [] getDerEncoding (RSAPublicKey key) throws IOException
 
static void writeDataWithLength (byte[] data, DataOutput byteBuffer) throws IOException
 

静的非公開変数類

static final Logger log = LoggerFactory.getLogger(FingerprintHelper.class)
 

詳解

Utility which help to calculate SSH RSA public key fingerprint

著者
Yuriy Movchan
バージョン
March 03, 2016

関数詳解

◆ getDerEncoding()

static byte [] org.xdi.oxauth.cert.fingerprint.FingerprintHelper.getDerEncoding ( RSAPublicKey  key) throws IOException
inlinestaticprivate
52  {
53  ByteArrayOutputStream buffer = new ByteArrayOutputStream();
54  DataOutputStream dataOutput = new DataOutputStream(buffer);
55  writeDataWithLength("ssh-rsa".getBytes(), dataOutput);
56  writeDataWithLength(key.getPublicExponent().toByteArray(), dataOutput);
57  writeDataWithLength(key.getModulus().toByteArray(), dataOutput);
58 
59  return buffer.toByteArray();
60  }
static void writeDataWithLength(byte[] data, DataOutput byteBuffer)
Definition: FingerprintHelper.java:62

◆ getPublicKeySshFingerprint() [1/2]

static String org.xdi.oxauth.cert.fingerprint.FingerprintHelper.getPublicKeySshFingerprint ( PublicKey  publicKey) throws NoSuchAlgorithmException, IOException
inlinestatic
35  {
36  if (publicKey instanceof RSAPublicKey) {
37  return getPublicKeySshFingerprint((RSAPublicKey) publicKey);
38  }
39 
40  throw new NoSuchAlgorithmException("Unsopported PublicKey type");
41  }
static String getPublicKeySshFingerprint(PublicKey publicKey)
Definition: FingerprintHelper.java:35

◆ getPublicKeySshFingerprint() [2/2]

static String org.xdi.oxauth.cert.fingerprint.FingerprintHelper.getPublicKeySshFingerprint ( RSAPublicKey  publicKey) throws NoSuchAlgorithmException, IOException
inlinestatic
43  {
44  MessageDigest digest = MessageDigest.getInstance("MD5");
45 
46  byte[] derEncoded = getDerEncoding(publicKey);
47  byte[] fingerprint = digest.digest(derEncoded);
48 
49  return Hex.encodeHexString(fingerprint);
50  }
static byte [] getDerEncoding(RSAPublicKey key)
Definition: FingerprintHelper.java:52

◆ writeDataWithLength()

static void org.xdi.oxauth.cert.fingerprint.FingerprintHelper.writeDataWithLength ( byte []  data,
DataOutput  byteBuffer 
) throws IOException
inlinestaticprivate
62  {
63  byteBuffer.writeInt(data.length);
64  byteBuffer.write(data);
65  }

メンバ詳解

◆ log

final Logger org.xdi.oxauth.cert.fingerprint.FingerprintHelper.log = LoggerFactory.getLogger(FingerprintHelper.class)
staticprivate

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