public class KrbClientBase extends Object
| Constructor and Description |
|---|
KrbClientBase()
Default constructor.
|
KrbClientBase(File confDir)
Constructor with conf dir
|
KrbClientBase(KrbClientBase krbClient)
Constructor with prepared KrbClientBase.
|
KrbClientBase(KrbConfig krbConfig)
Construct with prepared KrbConfig.
|
| Modifier and Type | Method and Description |
|---|---|
Credential |
getCredentialFromFile(File ccFile) |
KrbConfig |
getKrbConfig() |
KrbSetting |
getSetting()
Get krb client settings from options and configs.
|
TgtTicket |
getTgtTicketFromCredential(Credential cc) |
void |
init()
Init the client.
|
void |
renewTicket(SgtTicket sgtTicket,
File ccacheFile)
Store sgt into the specified credential cache file.
|
SgtTicket |
requestSgt(File ccFile,
String servicePrincipal)
Request a service ticket
|
SgtTicket |
requestSgt(org.apache.kerby.KOptions requestOptions)
Request a service ticket provided request options
|
SgtTicket |
requestSgt(TgtTicket tgt,
String serverPrincipal)
Request a service ticket with a TGT targeting for a server
|
TgtTicket |
requestTgt(org.apache.kerby.KOptions requestOptions)
Request a TGT with using well prepared requestOptions.
|
CredentialCache |
resolveCredCache(File ccacheFile) |
void |
setAllowTcp(boolean allowTcp)
Set to allow TCP or not.
|
void |
setAllowUdp(boolean allowUdp)
Set to allow UDP or not.
|
void |
setKdcHost(String kdcHost)
Set KDC host.
|
void |
setKdcRealm(String realm)
Set KDC realm for ticket request
|
void |
setKdcTcpPort(int kdcTcpPort)
Set KDC tcp port.
|
void |
setKdcUdpPort(int kdcUdpPort)
Set KDC udp port.
|
void |
setTimeout(int timeout)
Set time out for connection
|
void |
storeTicket(SgtTicket sgtTicket,
File ccacheFile)
Store sgt into the specified credential cache file.
|
void |
storeTicket(TgtTicket tgtTicket,
File ccacheFile)
Store tgt into the specified credential cache file.
|
public KrbClientBase()
throws KrbException
KrbException - epublic KrbClientBase(KrbConfig krbConfig)
krbConfig - The krb configpublic KrbClientBase(File confDir) throws KrbException
confDir - The conf dirKrbException - epublic KrbClientBase(KrbClientBase krbClient)
krbClient - The krb clientpublic void setKdcRealm(String realm)
realm - The realmpublic void setKdcHost(String kdcHost)
kdcHost - The kdc hostpublic void setKdcTcpPort(int kdcTcpPort)
kdcTcpPort - The kdc tcp portpublic void setAllowUdp(boolean allowUdp)
allowUdp - true if allow udppublic void setAllowTcp(boolean allowTcp)
allowTcp - true if allow tcppublic void setKdcUdpPort(int kdcUdpPort)
kdcUdpPort - The kdc udp portpublic void setTimeout(int timeout)
timeout - in secondspublic void init()
throws KrbException
KrbException - epublic KrbSetting getSetting()
public KrbConfig getKrbConfig()
public TgtTicket requestTgt(org.apache.kerby.KOptions requestOptions) throws KrbException
requestOptions - The request optionsKrbException - epublic SgtTicket requestSgt(TgtTicket tgt, String serverPrincipal) throws KrbException
tgt - The tgt ticketserverPrincipal - The server principalKrbException - epublic SgtTicket requestSgt(org.apache.kerby.KOptions requestOptions) throws KrbException
requestOptions - The request optionsKrbException - epublic SgtTicket requestSgt(File ccFile, String servicePrincipal) throws KrbException
ccFile - The credential cache fileservicePrincipal - The service principalKrbException - epublic void storeTicket(TgtTicket tgtTicket, File ccacheFile) throws KrbException
tgtTicket - The tgt ticketccacheFile - The credential cache fileKrbException - epublic void storeTicket(SgtTicket sgtTicket, File ccacheFile) throws KrbException
sgtTicket - The sgt ticketccacheFile - The credential cache fileKrbException - epublic void renewTicket(SgtTicket sgtTicket, File ccacheFile) throws KrbException
sgtTicket - The sgt ticketccacheFile - The credential cache fileKrbException - epublic TgtTicket getTgtTicketFromCredential(Credential cc)
public Credential getCredentialFromFile(File ccFile) throws KrbException
KrbExceptionpublic CredentialCache resolveCredCache(File ccacheFile) throws IOException
IOExceptionCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.