/** * Check whether secured attribute is already set for given vault block and attribute name. This * method can be called only after successful startVaultSession() call. * * @param vaultBlock * @param attributeName * @return true is password already exists for given vault block and attribute name. * @throws Exception */ public boolean checkSecuredAttribute(String vaultBlock, String attributeName) throws Exception { if (handshakeKey == null) { throw new Exception( "checkSecuredAttribute method has to be called after successful startVaultSession() call."); } return vault.exists(vaultBlock, attributeName); }
/** * Add secured attribute to specified vault block. This method can be called only after successful * startVaultSession() call. * * @param vaultBlock * @param attributeName * @param attributeValue */ public void addSecuredAttribute(String vaultBlock, String attributeName, char[] attributeValue) throws Exception { if (handshakeKey == null) { throw new Exception( "addSecuredAttribute method has to be called after successful startVaultSession() call."); } vault.store(vaultBlock, attributeName, attributeValue, handshakeKey); attributeCreatedDisplay(vaultBlock, attributeName); }
private void handshake() throws SecurityVaultException { Map<String, Object> handshakeOptions = new HashMap<String, Object>(); handshakeOptions.put(PicketBoxSecurityVault.PUBLIC_CERT, vaultAlias); handshakeKey = vault.handshake(handshakeOptions); }