public class KerberosUtils extends Object
Modifier and Type | Field and Description |
---|---|
static List<String> |
EMPTY_PRINCIPAL_NAME
An empty list of principal names
|
static int |
NULL
A constant for integer optional values
|
Constructor and Description |
---|
KerberosUtils() |
Modifier and Type | Method and Description |
---|---|
static EncryptionType |
getBestEncryptionType(Set<EncryptionType> requestedTypes,
Set<EncryptionType> configuredTypes)
Get the matching encryption type from the configured types, searching
into the requested types.
|
static String |
getEncryptionTypesString(Set<EncryptionType> encryptionTypes)
Build a list of encryptionTypes
|
static PrincipalStoreEntry |
getEntry(KerberosPrincipal principal,
PrincipalStore store,
ErrorType errorType)
Get a PrincipalStoreEntry given a principal.
|
static KerberosPrincipal |
getKerberosPrincipal(PrincipalName principal,
String realm)
Constructs a KerberosPrincipal from a PrincipalName and an
optional realm
|
static List<String> |
getNames(KerberosPrincipal principal)
Parse a KerberosPrincipal instance and return the names.
|
static List<String> |
getNames(String principalNames)
Parse a PrincipalName and return the names.
|
static Authenticator |
verifyAuthHeader(ApplicationRequest authHeader,
Ticket ticket,
EncryptionKey serverKey,
long clockSkew,
ReplayCache replayCache,
boolean emptyAddressesAllowed,
InetAddress clientAddress,
CipherTextHandler lockBox,
KeyUsage authenticatorKeyUsage,
boolean isValidate)
Verifies an AuthHeader using guidelines from RFC 1510 section A.10., "KRB_AP_REQ verification."
|
public static final int NULL
public static List<String> getNames(KerberosPrincipal principal) throws ParseException
principal
- The principal to be parsedParseException
- if the name is not validpublic static List<String> getNames(String principalNames) throws ParseException
ParseException
public static KerberosPrincipal getKerberosPrincipal(PrincipalName principal, String realm)
principal
- The principal name and typerealm
- The optional realmpublic static EncryptionType getBestEncryptionType(Set<EncryptionType> requestedTypes, Set<EncryptionType> configuredTypes)
requestedTypes
- The client encryption typesconfiguredTypes
- The configured encryption typespublic static String getEncryptionTypesString(Set<EncryptionType> encryptionTypes)
encryptionTypes
- The encryptionTypespublic static PrincipalStoreEntry getEntry(KerberosPrincipal principal, PrincipalStore store, ErrorType errorType) throws KerberosException
principal
- store
- errorType
- Exception
KerberosException
public static Authenticator verifyAuthHeader(ApplicationRequest authHeader, Ticket ticket, EncryptionKey serverKey, long clockSkew, ReplayCache replayCache, boolean emptyAddressesAllowed, InetAddress clientAddress, CipherTextHandler lockBox, KeyUsage authenticatorKeyUsage, boolean isValidate) throws KerberosException
authHeader
- ticket
- serverKey
- clockSkew
- replayCache
- emptyAddressesAllowed
- clientAddress
- lockBox
- authenticatorKeyUsage
- isValidate
- KerberosException
Copyright © 2003-2012 Apache Software Foundation. All Rights Reserved.