SEPublicKeyImplpublic class SEPublicKeyImpl extends Object implements org.gudy.azureus2.plugins.utils.security.SEPublicKey
Fields Summary |
---|
private int | type | private byte[] | encoded | private int | hashcode |
Constructors Summary |
---|
protected SEPublicKeyImpl(int _type, byte[] _encoded)
type = _type;
encoded = _encoded;
hashcode = new HashWrapper( encoded ).hashCode();
|
Methods Summary |
---|
public static org.gudy.azureus2.plugins.utils.security.SEPublicKey | decode(byte[] encoded)
int type = encoded[0]&0xff;
byte[] x = new byte[encoded.length-1];
System.arraycopy( encoded, 1, x, 0, x.length );
return( new SEPublicKeyImpl( type, x ));
| public byte[] | encodePublicKey()
byte[] res = new byte[encoded.length+1];
res[0] = (byte)type;
System.arraycopy( encoded, 0, res, 1, encoded.length );
return( res );
| public boolean | equals(java.lang.Object other)
if ( other instanceof SEPublicKeyImpl ){
return( Arrays.equals( encoded, ((SEPublicKeyImpl)other).encoded ));
}else{
return( false );
}
| public int | getType()
return( type );
| public int | hashCode()
return( hashcode );
|
|