FileDocCategorySizeDatePackage
SEPublicKeyImpl.javaAPI DocAzureus 3.0.3.42179Mon Jul 24 05:23:04 BST 2006org.gudy.azureus2.pluginsimpl.local.utils.security

SEPublicKeyImpl

public 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.SEPublicKeydecode(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 booleanequals(java.lang.Object other)

		if ( other instanceof SEPublicKeyImpl ){
			
			return( Arrays.equals( encoded, ((SEPublicKeyImpl)other).encoded ));
			
		}else{
			
			return( false );
		}
	
public intgetType()

		return( type );
	
public inthashCode()

		return( hashcode );