com.quartzdesk.api.web.security
Class SecurityTokenUtils

java.lang.Object
  extended by com.quartzdesk.api.web.security.SecurityTokenUtils

public final class SecurityTokenUtils
extends Object

Utility method for security token keys.

Version:
$Id:$
Author:
Jan Moravec

Method Summary
static SecurityToken decrypt(String symmetricKey, String securityTokenStr)
          Decrypts the specified encrypted security token using the provided symmetric (AES) key.
static String encrypt(String symmetricKey, SecurityToken securityToken)
          Encrypts the specified security token using the provided symmetric (AES) key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encrypt

public static String encrypt(String symmetricKey,
                             SecurityToken securityToken)
Encrypts the specified security token using the provided symmetric (AES) key.

Parameters:
symmetricKey - a symmetric AES key.
securityToken - a security token.
Returns:
the encrypted security token as a BASE64 encoded string.
Throws:
SecurityException - if an error occurs.

decrypt

public static SecurityToken decrypt(String symmetricKey,
                                    String securityTokenStr)
Decrypts the specified encrypted security token using the provided symmetric (AES) key.

Parameters:
symmetricKey - a symmetric AES key.
securityTokenStr - an encrypted security token.
Returns:
the decrypted security token.
Throws:
SecurityException - if an error occurs.


Copyright © 2013–2017 QuartzDesk.com. All rights reserved.