public class org.apache.shiro.authc.credential.HashedCredentialsMatcher extends org.apache.shiro.authc.credential.SimpleCredentialsMatcher
{
private java.lang.String hashAlgorithm;
private int hashIterations;
private boolean hashSalted;
private boolean storedCredentialsHexEncoded;
public void <init>()
{
org.apache.shiro.authc.credential.HashedCredentialsMatcher v;
v := @this: org.apache.shiro.authc.credential.HashedCredentialsMatcher;
specialinvoke v.<org.apache.shiro.authc.credential.SimpleCredentialsMatcher: void <init>()>();
v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: java.lang.String hashAlgorithm> = null;
v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: boolean hashSalted> = 0;
v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: int hashIterations> = 1;
v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: boolean storedCredentialsHexEncoded> = 1;
return;
}
public void <init>(java.lang.String)
{
org.apache.shiro.authc.credential.HashedCredentialsMatcher v;
java.lang.String v;
java.lang.IllegalArgumentException v;
boolean v;
v := @this: org.apache.shiro.authc.credential.HashedCredentialsMatcher;
v := @parameter: java.lang.String;
specialinvoke v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: void <init>()>();
v = staticinvoke <org.apache.shiro.util.StringUtils: boolean hasText(java.lang.String)>(v);
if v != 0 goto label;
v = new java.lang.IllegalArgumentException;
specialinvoke v.<java.lang.IllegalArgumentException: void <init>(java.lang.String)>("hashAlgorithmName cannot be null or empty.");
throw v;
label:
v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: java.lang.String hashAlgorithm> = v;
return;
}
public java.lang.String getHashAlgorithmName()
{
org.apache.shiro.authc.credential.HashedCredentialsMatcher v;
java.lang.String v;
v := @this: org.apache.shiro.authc.credential.HashedCredentialsMatcher;
v = v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: java.lang.String hashAlgorithm>;
return v;
}
public void setHashAlgorithmName(java.lang.String)
{
org.apache.shiro.authc.credential.HashedCredentialsMatcher v;
java.lang.String v;
v := @this: org.apache.shiro.authc.credential.HashedCredentialsMatcher;
v := @parameter: java.lang.String;
v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: java.lang.String hashAlgorithm> = v;
return;
}
public boolean isStoredCredentialsHexEncoded()
{
org.apache.shiro.authc.credential.HashedCredentialsMatcher v;
boolean v;
v := @this: org.apache.shiro.authc.credential.HashedCredentialsMatcher;
v = v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: boolean storedCredentialsHexEncoded>;
return v;
}
public void setStoredCredentialsHexEncoded(boolean)
{
org.apache.shiro.authc.credential.HashedCredentialsMatcher v;
boolean v;
v := @this: org.apache.shiro.authc.credential.HashedCredentialsMatcher;
v := @parameter: boolean;
v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: boolean storedCredentialsHexEncoded> = v;
return;
}
public boolean isHashSalted()
{
org.apache.shiro.authc.credential.HashedCredentialsMatcher v;
boolean v;
v := @this: org.apache.shiro.authc.credential.HashedCredentialsMatcher;
v = v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: boolean hashSalted>;
return v;
}
public void setHashSalted(boolean)
{
org.apache.shiro.authc.credential.HashedCredentialsMatcher v;
boolean v;
v := @this: org.apache.shiro.authc.credential.HashedCredentialsMatcher;
v := @parameter: boolean;
v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: boolean hashSalted> = v;
return;
}
public int getHashIterations()
{
int v;
org.apache.shiro.authc.credential.HashedCredentialsMatcher v;
v := @this: org.apache.shiro.authc.credential.HashedCredentialsMatcher;
v = v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: int hashIterations>;
return v;
}
public void setHashIterations(int)
{
int v;
org.apache.shiro.authc.credential.HashedCredentialsMatcher v;
v := @this: org.apache.shiro.authc.credential.HashedCredentialsMatcher;
v := @parameter: int;
if v >= 1 goto label;
v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: int hashIterations> = 1;
goto label;
label:
v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: int hashIterations> = v;
label:
return;
}
protected java.lang.Object getSalt(org.apache.shiro.authc.AuthenticationToken)
{
org.apache.shiro.authc.credential.HashedCredentialsMatcher v;
java.lang.Object v;
org.apache.shiro.authc.AuthenticationToken v;
v := @this: org.apache.shiro.authc.credential.HashedCredentialsMatcher;
v := @parameter: org.apache.shiro.authc.AuthenticationToken;
v = interfaceinvoke v.<org.apache.shiro.authc.AuthenticationToken: java.lang.Object getPrincipal()>();
return v;
}
protected java.lang.Object getCredentials(org.apache.shiro.authc.AuthenticationInfo)
{
byte[] v;
org.apache.shiro.authc.AuthenticationInfo v;
org.apache.shiro.authc.credential.HashedCredentialsMatcher v;
java.lang.Object v;
org.apache.shiro.crypto.hash.AbstractHash v;
boolean v, v, v;
v := @this: org.apache.shiro.authc.credential.HashedCredentialsMatcher;
v := @parameter: org.apache.shiro.authc.AuthenticationInfo;
v = interfaceinvoke v.<org.apache.shiro.authc.AuthenticationInfo: java.lang.Object getCredentials()>();
v = virtualinvoke v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: byte[] toBytes(java.lang.Object)>(v);
v = v instanceof java.lang.String;
if v != 0 goto label;
v = v instanceof char[];
if v == 0 goto label;
label:
v = virtualinvoke v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: boolean isStoredCredentialsHexEncoded()>();
if v == 0 goto label;
v = staticinvoke <org.apache.shiro.codec.Hex: byte[] decode(byte[])>(v);
goto label;
label:
v = staticinvoke <org.apache.shiro.codec.Base64: byte[] decode(byte[])>(v);
label:
v = virtualinvoke v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: org.apache.shiro.crypto.hash.AbstractHash newHashInstance()>();
virtualinvoke v.<org.apache.shiro.crypto.hash.AbstractHash: void setBytes(byte[])>(v);
return v;
}
public boolean doCredentialsMatch(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationInfo)
{
org.apache.shiro.authc.AuthenticationInfo v;
org.apache.shiro.authc.credential.HashedCredentialsMatcher v;
java.lang.Object v, v;
org.apache.shiro.authc.AuthenticationToken v;
boolean v;
v := @this: org.apache.shiro.authc.credential.HashedCredentialsMatcher;
v := @parameter: org.apache.shiro.authc.AuthenticationToken;
v := @parameter: org.apache.shiro.authc.AuthenticationInfo;
v = virtualinvoke v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: java.lang.Object hashProvidedCredentials(org.apache.shiro.authc.AuthenticationToken,org.apache.shiro.authc.AuthenticationInfo)>(v, v);
v = virtualinvoke v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: java.lang.Object getCredentials(org.apache.shiro.authc.AuthenticationInfo)>(v);
v = virtualinvoke v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: boolean equals(java.lang.Object,java.lang.Object)>(v, v);
return v;
}
protected java.lang.Object hashProvidedCredentials(org.apache.shiro.authc.AuthenticationToken, org.apache.shiro.authc.AuthenticationInfo)
{
org.apache.shiro.authc.AuthenticationInfo v;
org.apache.shiro.authc.credential.HashedCredentialsMatcher v;
org.apache.shiro.authc.AuthenticationToken v;
org.apache.shiro.crypto.hash.Hash v;
int v;
java.lang.Object v, v;
boolean v, v;
v := @this: org.apache.shiro.authc.credential.HashedCredentialsMatcher;
v := @parameter: org.apache.shiro.authc.AuthenticationToken;
v := @parameter: org.apache.shiro.authc.AuthenticationInfo;
v = null;
v = v instanceof org.apache.shiro.authc.SaltedAuthenticationInfo;
if v == 0 goto label;
v = interfaceinvoke v.<org.apache.shiro.authc.SaltedAuthenticationInfo: org.apache.shiro.util.ByteSource getCredentialsSalt()>();
goto label;
label:
v = virtualinvoke v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: boolean isHashSalted()>();
if v == 0 goto label;
v = virtualinvoke v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: java.lang.Object getSalt(org.apache.shiro.authc.AuthenticationToken)>(v);
label:
v = interfaceinvoke v.<org.apache.shiro.authc.AuthenticationToken: java.lang.Object getCredentials()>();
v = virtualinvoke v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: int getHashIterations()>();
v = virtualinvoke v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: org.apache.shiro.crypto.hash.Hash hashProvidedCredentials(java.lang.Object,java.lang.Object,int)>(v, v, v);
return v;
}
private java.lang.String assertHashAlgorithmName() throws java.lang.IllegalStateException
{
java.lang.IllegalStateException v;
org.apache.shiro.authc.credential.HashedCredentialsMatcher v;
java.lang.String v;
v := @this: org.apache.shiro.authc.credential.HashedCredentialsMatcher;
v = virtualinvoke v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: java.lang.String getHashAlgorithmName()>();
if v != null goto label;
v = new java.lang.IllegalStateException;
specialinvoke v.<java.lang.IllegalStateException: void <init>(java.lang.String)>("Required \'hashAlgorithmName\' property has not been set.  This is required to execute the hashing algorithm.");
throw v;
label:
return v;
}
protected org.apache.shiro.crypto.hash.Hash hashProvidedCredentials(java.lang.Object, java.lang.Object, int)
{
int v;
org.apache.shiro.authc.credential.HashedCredentialsMatcher v;
java.lang.Object v, v;
java.lang.String v;
org.apache.shiro.crypto.hash.SimpleHash v;
v := @this: org.apache.shiro.authc.credential.HashedCredentialsMatcher;
v := @parameter: java.lang.Object;
v := @parameter: java.lang.Object;
v := @parameter: int;
v = specialinvoke v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: java.lang.String assertHashAlgorithmName()>();
v = new org.apache.shiro.crypto.hash.SimpleHash;
specialinvoke v.<org.apache.shiro.crypto.hash.SimpleHash: void <init>(java.lang.String,java.lang.Object,java.lang.Object,int)>(v, v, v, v);
return v;
}
protected org.apache.shiro.crypto.hash.AbstractHash newHashInstance()
{
org.apache.shiro.authc.credential.HashedCredentialsMatcher v;
java.lang.String v;
org.apache.shiro.crypto.hash.SimpleHash v;
v := @this: org.apache.shiro.authc.credential.HashedCredentialsMatcher;
v = specialinvoke v.<org.apache.shiro.authc.credential.HashedCredentialsMatcher: java.lang.String assertHashAlgorithmName()>();
v = new org.apache.shiro.crypto.hash.SimpleHash;
specialinvoke v.<org.apache.shiro.crypto.hash.SimpleHash: void <init>(java.lang.String)>(v);
return v;
}
}