use of org.firebirdsql.gds.ng.wire.crypt.KnownServerKey in project jaybird by FirebirdSQL.
the class WireConnection method addServerKeys.
void addServerKeys(byte[] serverKeys) throws SQLException {
final ClumpletReader newKeys = new ClumpletReader(ClumpletReader.Kind.UnTagged, serverKeys);
for (newKeys.rewind(); !newKeys.isEof(); newKeys.moveNext()) {
if (newKeys.getClumpTag() == TAG_KNOWN_PLUGINS) {
continue;
}
int currentTag = newKeys.getClumpTag();
if (currentTag != TAG_KEY_TYPE) {
throw new SQLException("Unexpected tag type: " + currentTag);
}
String keyType = newKeys.getString(StandardCharsets.US_ASCII);
newKeys.moveNext();
if (newKeys.isEof()) {
break;
}
currentTag = newKeys.getClumpTag();
if (currentTag != TAG_KEY_PLUGINS) {
throw new SQLException("Unexpected tag type: " + currentTag);
}
String keyPlugins = newKeys.getString(StandardCharsets.US_ASCII);
knownServerKeys.add(new KnownServerKey(keyType, keyPlugins));
}
}
Aggregations