com.davfx.ninio.ssh.DssSshPublicKey Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ninio Show documentation
Show all versions of ninio Show documentation
A Java NIO HTTP client/server as light as possible
package com.davfx.ninio.ssh;
import java.nio.ByteBuffer;
import java.security.PublicKey;
import java.security.interfaces.DSAPublicKey;
public final class DssSshPublicKey implements SshPublicKey {
private final DSAPublicKey publicKey;
public DssSshPublicKey(DSAPublicKey publicKey) {
this.publicKey = publicKey;
}
@Override
public PublicKey getPublicKey() {
return publicKey;
}
@Override
public String getAlgorithm() {
return "ssh-dss";
}
@Override
public ByteBuffer getBlob() {
SshPacketBuilder k = new SshPacketBuilder();
k.writeString(getAlgorithm());
k.writeBlob(publicKey.getParams().getP().toByteArray());
k.writeBlob(publicKey.getParams().getQ().toByteArray());
k.writeBlob(publicKey.getParams().getG().toByteArray());
k.writeBlob(publicKey.getY().toByteArray());
return k.finish();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy