# java.security.Identity is biased towards PublicKey

Vishal Goenka (vgoenka@novell.com)
Tue, 09 Jun 1998 07:23:32 -0600

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: ADM. Diego Cueva: "Help !!"
- Previous message: Wolfgang Platzer: "Smartcards!"

    Message-Id: <s57ce318.054@novell.com>

    Date: Tue, 09 Jun 1998 07:23:32 -0600

    From: "Vishal Goenka" <vgoenka@novell.com>

    To: java-security@web2.javasoft.com

    Subject: java.security.Identity is biased towards PublicKey

The Identity class in java.security is designed primarily for public key =
crypto-system. A good alternative would have been to abstract the =
credentials contained therein (public key and certificates) as a different =
class/interface, to allow easy integration of credentials for other =
crypto-systems (such as secret key based, or simple password based =
systems).=20

This would imply defining an interface as :
public interface Credentials {
...
}

The public-key/certificate related methods in Identity would move to a =
subclass, something like :
public class PublicKeyCredentials implements Credentials {
public PublicKey getPublicKey() {...}
.....
}
and the Identity class would have methods like=20
public Credentials getCredentials();
public void setCredentials(Credentials creds);
instead of methods for publicKey/certificates.

For SecretKey crypto-systems, it may not be desirable to expose the secret =
keys via methods like getSecretKey(). One alternative is to expose it in =
encoded form (password encoded or otherwise) via public byte[] getEncodedSe=
cretKey(). Another alternative would be to rely on a Key management =
infrastructure for secret key exposition. Yet another option may be doing =
a security check before returning the secretKey (similiar to the permission=
s based checks for setPublicKey() in Identity class as of today). Probably =
this area needs some more thought.

Comments.

Vishal Goenka
Novell

- Next message: ADM. Diego Cueva: "Help !!"
- Previous message: Wolfgang Platzer: "Smartcards!"