public class SipSecurityManager
extends java.lang.Object
Constructor and Description |
---|
SipSecurityManager(AccountID accountID,
ProtocolProviderServiceSipImpl protocolProvider)
Default constructor for the security manager.
|
Modifier and Type | Method and Description |
---|---|
void |
cacheCredentials(java.lang.String realm,
UserCredentials credentials)
Caches realm and credentials for later usage.
|
javax.sip.header.AuthorizationHeader |
getCachedAuthorizationHeader(java.lang.String callID)
Returns an authorization header cached against the specified
callID or null if no auth.
|
SecurityAuthority |
getSecurityAuthority()
Returns the SecurityAuthority instance that SipSecurityManager uses to
obtain user credentials.
|
javax.sip.ClientTransaction |
handleChallenge(javax.sip.message.Response challenge,
javax.sip.ClientTransaction challengedTransaction,
javax.sip.SipProvider transactionCreator)
Uses securityAuthority to determine a set of valid user credentials
for the specified Response (Challenge) and appends it to the challenged
request so that it could be retransmitted.
|
javax.sip.ClientTransaction |
handleChallenge(javax.sip.message.Response challenge,
javax.sip.ClientTransaction challengedTransaction,
javax.sip.SipProvider transactionCreator,
long newCSeq)
Uses securityAuthority to determine a set of valid user credentials
for the specified Response (Challenge) and appends it to the challenged
request so that it could be retransmitted.
|
javax.sip.ClientTransaction |
handleForbiddenResponse(javax.sip.message.Response forbidden,
javax.sip.ClientTransaction endedTransaction,
javax.sip.SipProvider transactionCreator)
Handles a 403 Forbidden response.
|
void |
setHeaderFactory(javax.sip.header.HeaderFactory headerFactory)
Set the header factory to be used when creating authorization headers
|
void |
setSecurityAuthority(SecurityAuthority authority)
Sets the SecurityAuthority instance that should be queried for user
credentials.
|
public SipSecurityManager(AccountID accountID, ProtocolProviderServiceSipImpl protocolProvider)
accountID
- the id of the account that this security manager is
going to serve.public void setHeaderFactory(javax.sip.header.HeaderFactory headerFactory)
headerFactory
- the header factory that we'll be using when creating
authorization headers.public javax.sip.ClientTransaction handleChallenge(javax.sip.message.Response challenge, javax.sip.ClientTransaction challengedTransaction, javax.sip.SipProvider transactionCreator) throws javax.sip.SipException, javax.sip.InvalidArgumentException, OperationFailedException, java.lang.NullPointerException
challenge
- the 401/407 challenge responsechallengedTransaction
- the transaction established by the
challenged requesttransactionCreator
- the JAIN SipProvider that we should use to
create the new transaction.javax.sip.SipException
- if we get an exception white creating the
new transactionjavax.sip.InvalidArgumentException
- if we fail to create a new header
containing user credentials.java.lang.NullPointerException
- if an argument or a header is null.OperationFailedException
- if we fail to acquire a password from
our security authority.public javax.sip.ClientTransaction handleChallenge(javax.sip.message.Response challenge, javax.sip.ClientTransaction challengedTransaction, javax.sip.SipProvider transactionCreator, long newCSeq) throws javax.sip.SipException, javax.sip.InvalidArgumentException, OperationFailedException, java.lang.NullPointerException
challenge
- the 401/407 challenge responsechallengedTransaction
- the transaction established by the
challenged requesttransactionCreator
- the JAIN SipProvider that we should use to
create the new transaction.newCSeq
- if the caller is generating its own cseqs can supply such,
otherwise can provide -1 for auto generating it. Mean that the value
from the initial request will be incremented.javax.sip.SipException
- if we get an exception white creating the
new transactionjavax.sip.InvalidArgumentException
- if we fail to create a new header
containing user credentials.java.lang.NullPointerException
- if an argument or a header is null.OperationFailedException
- if we fail to acquire a password from
our security authority.public void setSecurityAuthority(SecurityAuthority authority)
authority
- the SecurityAuthority instance that should be queried
for user credentials.public SecurityAuthority getSecurityAuthority()
public javax.sip.ClientTransaction handleForbiddenResponse(javax.sip.message.Response forbidden, javax.sip.ClientTransaction endedTransaction, javax.sip.SipProvider transactionCreator) throws javax.sip.InvalidArgumentException, javax.sip.TransactionUnavailableException, OperationFailedException
forbidden
- the 401/407 challenge responseendedTransaction
- the transaction established by the challenged
requesttransactionCreator
- the JAIN SipProvider that we should use to
create the new transaction.javax.sip.InvalidArgumentException
- if we fail to create a new header
containing user credentials.javax.sip.TransactionUnavailableException
- if we get an exception white
creating the new transactionOperationFailedException
public void cacheCredentials(java.lang.String realm, UserCredentials credentials)
realm
- thecredentials
- UserCredentialspublic javax.sip.header.AuthorizationHeader getCachedAuthorizationHeader(java.lang.String callID)
callID
- the ID of the call that we'd like to reString
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.