- All Known Implementing Classes:
NtlmContext
public interface SSPContext
Security Support Provider (SSP) context.
This interface provides context for security support provider
operations during SMB authentication.
- Author:
- mbechler
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]calculateMIC(byte[] data) Calculates a Message Integrity Code (MIC) for the given data.voiddispose()Disposes of the security context and releases any associated resources.intgetFlags()Gets the negotiated context flags.Gets the NetBIOS name of the remote endpoint.byte[]Gets the signing key for the session.org.bouncycastle.asn1.ASN1ObjectIdentifier[]Gets the array of supported security mechanism OIDs.byte[]initSecContext(byte[] token, int off, int len) Initializes the security context with the given token.booleanChecks whether the security context is established.booleanChecks whether Message Integrity Code (MIC) is available for use.booleanisPreferredMech(org.bouncycastle.asn1.ASN1ObjectIdentifier selectedMech) Checks whether the specified mechanism is the preferred mechanism.booleanisSupported(org.bouncycastle.asn1.ASN1ObjectIdentifier mechanism) Checks whether the specified security mechanism is supported.booleanChecks whether this mechanism supports message integrity.voidverifyMIC(byte[] data, byte[] mic) Verifies a Message Integrity Code (MIC) for the given data.
-
Method Details
-
getSigningKey
Gets the signing key for the session.- Returns:
- the signing key for the session
- Throws:
CIFSException- if an error occurs retrieving the signing key
-
isEstablished
boolean isEstablished()Checks whether the security context is established.- Returns:
- whether the context is established
-
initSecContext
Initializes the security context with the given token.- Parameters:
token- the input token bytesoff- offset into the token arraylen- length of token data- Returns:
- result token
- Throws:
SmbException- if an SMB protocol error occursCIFSException- if a general CIFS error occurs
-
getNetbiosName
String getNetbiosName()Gets the NetBIOS name of the remote endpoint.- Returns:
- the name of the remote endpoint
-
dispose
Disposes of the security context and releases any associated resources.- Throws:
CIFSException- if an error occurs during disposal
-
isSupported
boolean isSupported(org.bouncycastle.asn1.ASN1ObjectIdentifier mechanism) Checks whether the specified security mechanism is supported.- Parameters:
mechanism- the security mechanism OID to check- Returns:
- whether the specified mechanism is supported
-
isPreferredMech
boolean isPreferredMech(org.bouncycastle.asn1.ASN1ObjectIdentifier selectedMech) Checks whether the specified mechanism is the preferred mechanism.- Parameters:
selectedMech- the selected mechanism OID- Returns:
- whether the specified mechanism is preferred
-
getFlags
int getFlags()Gets the negotiated context flags.- Returns:
- context flags
-
getSupportedMechs
org.bouncycastle.asn1.ASN1ObjectIdentifier[] getSupportedMechs()Gets the array of supported security mechanism OIDs.- Returns:
- array of supported mechanism OIDs
-
supportsIntegrity
boolean supportsIntegrity()Checks whether this mechanism supports message integrity.- Returns:
- whether this mechanisms supports integrity
-
calculateMIC
Calculates a Message Integrity Code (MIC) for the given data.- Parameters:
data- the data to calculate MIC for- Returns:
- MIC
- Throws:
CIFSException- if an error occurs calculating the MIC
-
verifyMIC
Verifies a Message Integrity Code (MIC) for the given data.- Parameters:
data- the data to verifymic- the MIC to verify against- Throws:
CIFSException- if the MIC verification fails or an error occurs
-
isMICAvailable
boolean isMICAvailable()Checks whether Message Integrity Code (MIC) is available for use.- Returns:
- whether MIC can be used
-