public class PlainTextSignatureMethod extends Object implements OAuthSignatureMethod
Modifier and Type | Field and Description |
---|---|
static String |
SIGNATURE_NAME
The name of this plain text signature method ("PLAINTEXT").
|
Constructor and Description |
---|
PlainTextSignatureMethod(String secret)
Construct a plain text signature method with the given plain-text secret.
|
PlainTextSignatureMethod(String secret,
org.springframework.security.authentication.encoding.PasswordEncoder encoder,
Object salt)
Construct a plain text signature method with the given plain-text secret.
|
Modifier and Type | Method and Description |
---|---|
String |
getName()
The name of this plain text signature method ("PLAINTEXT").
|
String |
getSecret()
The secret.
|
String |
sign(String signatureBaseString)
The signature is the same as the secret.
|
void |
verify(String signatureBaseString,
String signature)
Validates that the signature is the same as the secret.
|
public static final String SIGNATURE_NAME
public PlainTextSignatureMethod(String secret)
secret
- The secret.public PlainTextSignatureMethod(String secret, org.springframework.security.authentication.encoding.PasswordEncoder encoder, Object salt)
secret
- The secret.encoder
- The password encoder, or null if none is to be used.salt
- The salt for the secret, if any.public String getName()
getName
in interface OAuthSignatureMethod
public String sign(String signatureBaseString)
sign
in interface OAuthSignatureMethod
signatureBaseString
- The signature base string (unimportant, ignored).public void verify(String signatureBaseString, String signature) throws InvalidSignatureException
verify
in interface OAuthSignatureMethod
signatureBaseString
- The signature base string (unimportant, ignored).signature
- The signature.InvalidSignatureException
- If the signature is not the same as the secret.public String getSecret()
Copyright © 2019. All rights reserved.