Package ptolemy.actor.lib.security
Class KeyToken
- java.lang.Object
-
- ptolemy.data.Token
-
- ptolemy.actor.lib.security.KeyToken
-
public class KeyToken extends Token
Tokens that contain java.security.Keys.- Since:
- Ptolemy II 4.0
- Version:
- $Id$
- Author:
- Christopher Hylands Brooks, Based on TestToken by Steve Neuendorffer
- Pt.AcceptedRating:
- Yellow (cxh)
- Pt.ProposedRating:
- Yellow (cxh)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KeyToken.KeyType
The cryptographic key type.
-
Constructor Summary
Constructors Constructor Description KeyToken(java.security.Key value)
Construct a token with a specified java.security.Key.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Type
getType()
Return the type of this token.java.security.Key
getValue()
Return the java.security.Key.BooleanToken
isEqualTo(Token rightArgument)
Test for equality of the values of this Token and the argument Token.java.lang.String
toString()
Return a String representation of the KeyToken.-
Methods inherited from class ptolemy.data.Token
add, addReverse, divide, divideReverse, isCloseTo, isCloseTo, isNil, modulo, moduloReverse, multiply, multiplyReverse, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, one, pow, subtract, subtractReverse, zero, zeroReturnType
-
-
-
-
Field Detail
-
KEY
public static final Type KEY
The Key type: the least upper bound of all the cryptographic key types.
-
-
Method Detail
-
getType
public Type getType()
Return the type of this token.
-
getValue
public java.security.Key getValue()
Return the java.security.Key.- Returns:
- The java.security.Key that this Token was created with.
-
isEqualTo
public final BooleanToken isEqualTo(Token rightArgument) throws IllegalActionException
Test for equality of the values of this Token and the argument Token. Two KeyTokens are considered equals if the strings that name their corresponding algorithms and formats are the same and the byte arrays that contain the encoding have the same contents. Consult the java.security.Key documentation for the meaning of these terms. If the value of this token or the value of the rightArgument token is null, then we return False.- Overrides:
isEqualTo
in classToken
- Parameters:
rightArgument
- The Token to test against.- Returns:
- A boolean token that contains the value true if the algorithms, formats and encodings are the same.
- Throws:
IllegalActionException
- Not thrown in this base class.
-
-