FileDocCategorySizeDatePackage
XYZIdentity.javaAPI DocExample1372Mon Jan 15 13:19:22 GMT 2001javasec.samples.appc

XYZIdentity

public class XYZIdentity extends Identity

Fields Summary
private int
trustLevel
Constructors Summary
protected XYZIdentity()

    
public XYZIdentity(String name, IdentityScope scope)

        super(name, scope);
        scope.addIdentity(this);
        trustLevel = 0;
    
Methods Summary
public voidaddCertificate(java.security.Certificate cert)

        Identity i = getScope().getIdentity(cert.getPublicKey());
        if (i != null && !equals(i))
            throw new KeyManagementException("Duplicate public key");
        super.addCertificate(cert);
    
public intgetTrust()

        return trustLevel;
    
public voidsetPublicKey(java.security.PublicKey key)

        IdentityScope is = getScope();
        Identity i = is.getIdentity(key);
        if (i != null && !equals(i))
            throw new KeyManagementException("Duplicate public key");
        super.setPublicKey(key);
    
voidsetTrust(int x)

        if (x < 0 || x > 10)
            throw new IllegalArgumentException("Invalid trust level");
        trustLevel = x;
    
public java.lang.StringtoString()

        return super.toString() + " trust level: " + trustLevel;