@Test public void testPassphraseChange() throws NoSuchAlgorithmException, InternalSecurityException, CryptoException, AgentAccessDeniedException, AgentLockedException, AgentOperationFailedException { String passphrase = "a passphrase"; UserAgentImpl a = UserAgentImpl.createUserAgent(passphrase); String sndPass = "ein anderes Passphrase"; try { a.changePassphrase(sndPass); fail("AgentLockedException expected"); } catch (AgentLockedException e) { } a.unlock(passphrase); a.changePassphrase(sndPass); a.lockPrivateKey(); try { a.unlock(passphrase); fail("AgentAccessDeniedException expected"); } catch (AgentAccessDeniedException e) { } a.unlock(sndPass); }
public static UserAgentImpl createUserAgent(String passphrase) throws CryptoException, AgentOperationFailedException { byte[] salt = CryptoTools.generateSalt(); return new UserAgentImpl(CryptoTools.generateKeyPair(), passphrase, salt); }
UserAgentImpl extends PassphraseAgentImpl implements UserAgent { public static UserAgentImpl createUserAgent(String passphrase) throws CryptoException, AgentOperationFailedException { byte[] salt = CryptoTools.generateSalt(); return new UserAgentImpl(CryptoTools.generateKeyPair(), passphrase, salt); } }
UserAgentImpl extends PassphraseAgentImpl implements UserAgent { public static UserAgentImpl createUserAgent(String passphrase) throws CryptoException, AgentOperationFailedException { byte[] salt = CryptoTools.generateSalt(); return new UserAgentImpl(CryptoTools.generateKeyPair(), passphrase, salt); } protected  UserAgentImpl(KeyPair pair, String passphrase, byte[] salt); protected  UserAgentImpl(PublicKey pubKey, byte[] encryptedPrivate, byte[] salt); }
UserAgentImpl extends PassphraseAgentImpl implements UserAgent { public static UserAgentImpl createUserAgent(String passphrase) throws CryptoException, AgentOperationFailedException { byte[] salt = CryptoTools.generateSalt(); return new UserAgentImpl(CryptoTools.generateKeyPair(), passphrase, salt); } protected  UserAgentImpl(KeyPair pair, String passphrase, byte[] salt); protected  UserAgentImpl(PublicKey pubKey, byte[] encryptedPrivate, byte[] salt); @Override String getLoginName(); @Override boolean hasLoginName(); @Override void setLoginName(String loginName); @Override void setEmail(String email); @Override String toXmlString(); static UserAgentImpl createFromXml(String xml); static UserAgentImpl createUserAgent(String passphrase); static UserAgentImpl createFromXml(Element root); @Override void receiveMessage(Message message, AgentContext context); @Override void notifyUnregister(); @Override String getEmail(); @Override boolean hasEmail(); }
UserAgentImpl extends PassphraseAgentImpl implements UserAgent { public static UserAgentImpl createUserAgent(String passphrase) throws CryptoException, AgentOperationFailedException { byte[] salt = CryptoTools.generateSalt(); return new UserAgentImpl(CryptoTools.generateKeyPair(), passphrase, salt); } protected  UserAgentImpl(KeyPair pair, String passphrase, byte[] salt); protected  UserAgentImpl(PublicKey pubKey, byte[] encryptedPrivate, byte[] salt); @Override String getLoginName(); @Override boolean hasLoginName(); @Override void setLoginName(String loginName); @Override void setEmail(String email); @Override String toXmlString(); static UserAgentImpl createFromXml(String xml); static UserAgentImpl createUserAgent(String passphrase); static UserAgentImpl createFromXml(Element root); @Override void receiveMessage(Message message, AgentContext context); @Override void notifyUnregister(); @Override String getEmail(); @Override boolean hasEmail();  }