info.magnolia.cms.security
Class SecurityUtil
java.lang.Object
info.magnolia.cms.security.SecurityUtil
public class SecurityUtil
- extends Object
Utility functions required in the context of Security.
- Version:
- $Id: SecurityUtil.java 56096 2012-03-15 14:02:20Z fgrilli $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SecurityUtil
public SecurityUtil()
isAnonymous
public static boolean isAnonymous()
- Checks if the currently acting user is anonymous.
isAuthenticated
public static boolean isAuthenticated()
decrypt
public static String decrypt(String pass)
throws SecurityException
- Throws:
SecurityException
decrypt
public static String decrypt(String message,
String encodedKey)
throws SecurityException
- Throws:
SecurityException
encrypt
public static String encrypt(String pass)
throws SecurityException
- Throws:
SecurityException
encrypt
public static String encrypt(String message,
String encodedKey)
getPrivateKey
public static String getPrivateKey()
updateKeys
public static void updateKeys(MgnlKeyPair keys)
getPublicKey
public static String getPublicKey()
byteArrayToHex
public static String byteArrayToHex(byte[] raw)
hexToByteArray
public static byte[] hexToByteArray(String s)
generateKeyPair
public static MgnlKeyPair generateKeyPair(int keyLength)
throws NoSuchAlgorithmException
- Throws:
NoSuchAlgorithmException
stripPasswordFromCacheLog
public static String stripPasswordFromCacheLog(String log)
- Used for removing password parameter from cache key.
- Parameters:
cacheKey.toString()
-
- Returns:
stripPasswordFromUrl
public static String stripPasswordFromUrl(String url)
stripParameterFromCacheLog
public static String stripParameterFromCacheLog(String log,
String parameter)
Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.