![JAR search and dependency download from the Maven repository](/logo.png)
jcifs.smb.SecurityBlob Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jcifs-krb5-jdk7 Show documentation
Show all versions of jcifs-krb5-jdk7 Show documentation
JCIFS is an Open Source client library that implements the CIFS/SMB networking protocol in 100% Java
package jcifs.smb;
// >>SmbAuthenticator
/**
* This class represents the Secrity_Blob in SMB Block and is set to support
* kerberos authentication.
*
* @author Shun
*
*/
class SecurityBlob {
private byte[] b = new byte[0];
SecurityBlob(){}
SecurityBlob(byte[] b){
set(b);
}
void set(byte[] b){
this.b = b==null?new byte[0]:b;
}
byte[] get(){
return this.b;
}
int length(){
if(b==null)return 0;
return b.length;
}
/* (non-Javadoc)
* @see java.lang.Object#clone()
*/
protected Object clone() throws CloneNotSupportedException {
return (SecurityBlob)new SecurityBlob((byte[])this.b.clone());
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals(Object arg0) {
try{
SecurityBlob t = (SecurityBlob)arg0;
for (int i = 0; i < b.length; i++) {
if(b[i]!=t.b[i]){
return false;
}
}
return true;
}catch(Throwable e){
return false;
}
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
return b.hashCode();
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
public String toString() {
String ret = "";
for (int i = 0; i < b.length; i++) {
int n = b[i] & 0xff;
if(n<=0x0f){
ret += "0";
}
ret += Integer.toHexString(n);
}
return ret;
}
}
// SmbAuthenticator<<
© 2015 - 2025 Weber Informatics LLC | Privacy Policy