(KeyPair pair, Class<K> clazz)
| 40 | } |
| 41 | |
| 42 | public static <K> K getKey(KeyPair pair, Class<K> clazz) { |
| 43 | Assert.notNull(pair, "KeyPair cannot be null."); |
| 44 | String prefix = familyPrefix(clazz) + "KeyPair "; |
| 45 | boolean isPrivate = PrivateKey.class.isAssignableFrom(clazz); |
| 46 | Key key = isPrivate ? pair.getPrivate() : pair.getPublic(); |
| 47 | return assertKey(key, clazz, prefix); |
| 48 | } |
| 49 | |
| 50 | public static <K> K assertKey(Key key, Class<K> clazz, String msgPrefix) { |
| 51 | Assert.notNull(key, "Key argument cannot be null."); |
no test coverage detected