deprecate most of LeaseSetKeys

This commit is contained in:
zzz
2013-09-01 12:12:05 +00:00
parent 6ae46abac0
commit e3a5cdbbc2

View File

@ -20,17 +20,18 @@ import net.i2p.data.PrivateKey;
import net.i2p.data.SigningPrivateKey; import net.i2p.data.SigningPrivateKey;
/** /**
* Wrap up the keys given to the router when a destination connects to it * Wrap up the keys given to the router when a destination connects to it.
* * Used only by KeyManager.
*/ */
public class LeaseSetKeys extends DataStructureImpl { public class LeaseSetKeys extends DataStructureImpl {
private Destination _dest; private Destination _dest;
private SigningPrivateKey _revocationKey; private SigningPrivateKey _revocationKey;
private PrivateKey _decryptionKey; private PrivateKey _decryptionKey;
public LeaseSetKeys() { /** @deprecated unused */
this(null, null, null); public LeaseSetKeys() {}
}
/** @param revocationKey unused */
public LeaseSetKeys(Destination dest, SigningPrivateKey revocationKey, PrivateKey decryptionKey) { public LeaseSetKeys(Destination dest, SigningPrivateKey revocationKey, PrivateKey decryptionKey) {
_dest = dest; _dest = dest;
_revocationKey = revocationKey; _revocationKey = revocationKey;
@ -39,13 +40,18 @@ public class LeaseSetKeys extends DataStructureImpl {
/** /**
* Destination in question * Destination in question
*
* @deprecated unused
*/ */
public Destination getDestination() { return _dest; } public Destination getDestination() { return _dest; }
/** /**
* Key with which a LeaseSet can be revoked (by republishing it with no Leases) * Key with which a LeaseSet can be revoked (by republishing it with no Leases)
* *
* @deprecated unused
*/ */
public SigningPrivateKey getRevocationKey() { return _revocationKey; } public SigningPrivateKey getRevocationKey() { return _revocationKey; }
/** /**
* Decryption key which can open up garlic messages encrypted to the * Decryption key which can open up garlic messages encrypted to the
* LeaseSet's public key. This is used because the general public does not * LeaseSet's public key. This is used because the general public does not
@ -55,6 +61,7 @@ public class LeaseSetKeys extends DataStructureImpl {
*/ */
public PrivateKey getDecryptionKey() { return _decryptionKey; } public PrivateKey getDecryptionKey() { return _decryptionKey; }
/** @deprecated unused */
public void readBytes(InputStream in) throws DataFormatException, IOException { public void readBytes(InputStream in) throws DataFormatException, IOException {
_dest = new Destination(); _dest = new Destination();
_dest.readBytes(in); _dest.readBytes(in);
@ -64,6 +71,7 @@ public class LeaseSetKeys extends DataStructureImpl {
_revocationKey.readBytes(in); _revocationKey.readBytes(in);
} }
/** @deprecated unused */
public void writeBytes(OutputStream out) throws DataFormatException, IOException { public void writeBytes(OutputStream out) throws DataFormatException, IOException {
if (_dest == null) throw new DataFormatException("Null destination"); if (_dest == null) throw new DataFormatException("Null destination");
if (_decryptionKey == null) throw new DataFormatException("Null decryption key"); if (_decryptionKey == null) throw new DataFormatException("Null decryption key");
@ -73,15 +81,16 @@ public class LeaseSetKeys extends DataStructureImpl {
_revocationKey.writeBytes(out); _revocationKey.writeBytes(out);
} }
/** @deprecated unused */
@Override @Override
public int hashCode() { public int hashCode() {
int rv = 0; int rv = DataHelper.hashCode(_dest);
rv += DataHelper.hashCode(_dest);
rv += DataHelper.hashCode(_revocationKey); rv += DataHelper.hashCode(_revocationKey);
rv += DataHelper.hashCode(_decryptionKey); rv += DataHelper.hashCode(_decryptionKey);
return rv; return rv;
} }
/** @deprecated unused */
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if ( (obj != null) && (obj instanceof LeaseSetKeys) ) { if ( (obj != null) && (obj instanceof LeaseSetKeys) ) {