當前位置: 首頁>>代碼示例>>Java>>正文


Java GSSName.NT_HOSTBASED_SERVICE屬性代碼示例

本文整理匯總了Java中org.ietf.jgss.GSSName.NT_HOSTBASED_SERVICE屬性的典型用法代碼示例。如果您正苦於以下問題:Java GSSName.NT_HOSTBASED_SERVICE屬性的具體用法?Java GSSName.NT_HOSTBASED_SERVICE怎麽用?Java GSSName.NT_HOSTBASED_SERVICE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.ietf.jgss.GSSName的用法示例。


在下文中一共展示了GSSName.NT_HOSTBASED_SERVICE屬性的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getOidForType

private Oid getOidForType(
                           String type ) {

    if ("NT_USER_NAME".equals(type)) {
        return GSSName.NT_USER_NAME;
    } else if ("NT_HOSTBASED_SERVICE".equals(type)) {
        return GSSName.NT_HOSTBASED_SERVICE;
    } else if ("NT_MACHINE_UID_NAME".equals(type)) {
        return GSSName.NT_MACHINE_UID_NAME;
    } else if ("NT_STRING_UID_NAME".equals(type)) {
        return GSSName.NT_STRING_UID_NAME;
    } else if ("NT_ANONYMOUS".equals(type)) {
        return GSSName.NT_ANONYMOUS;
    } else if ("NT_EXPORT_NAME".equals(type)) {
        return GSSName.NT_EXPORT_NAME;
    }
    return GSSName.NT_USER_NAME;
}
 
開發者ID:Axway,項目名稱:ats-framework,代碼行數:18,代碼來源:SPNegoSchemeFactory.java

示例2: testGetNamesForMech

public void testGetNamesForMech() throws Exception {
	Oid kerberosMech = new Oid("1.2.840.113554.1.2.2");
	Oid[] nameTypes = gssManager.getNamesForMech(kerberosMech);
	Oid[] expectedNameTypes = new Oid[] { GSSName.NT_USER_NAME,
			GSSName.NT_HOSTBASED_SERVICE, GSSName.NT_EXPORT_NAME,
			KerberosUtils.KRB5_PRINCIPAL_NAMETYPE };
	assertEquals(expectedNameTypes.length, nameTypes.length);
	for (Oid expectedNameType : expectedNameTypes) {
		boolean got = false;
		for (Oid nameType : nameTypes) {
			if (nameType.equals(expectedNameType)) {
				got = true;
				break;
			}
		}
		if (!got) {
			fail("Missing expected NameType " + expectedNameType);
		}
	}
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:20,代碼來源:GSSManagerImplTest.java

示例3: testGetMechsForName

public void testGetMechsForName() throws Exception {
	Oid nameType = GSSName.NT_ANONYMOUS;
	Oid[] mechs = gssManager.getMechsForName(nameType);
	assertEquals(0, mechs.length);

	nameType = GSSName.NT_MACHINE_UID_NAME;
	mechs = gssManager.getMechsForName(nameType);
	assertEquals(0, mechs.length);

	nameType = GSSName.NT_STRING_UID_NAME;
	mechs = gssManager.getMechsForName(nameType);
	assertEquals(0, mechs.length);

	nameType = GSSName.NT_USER_NAME;
	mechs = gssManager.getMechsForName(nameType);
	Oid kerberosMech = new Oid("1.2.840.113554.1.2.2");
	Oid[] expectedMechs = new Oid[] { kerberosMech };
	assertTrue(Arrays.equals(expectedMechs, mechs));

	nameType = GSSName.NT_HOSTBASED_SERVICE;
	mechs = gssManager.getMechsForName(nameType);
	assertTrue(Arrays.equals(expectedMechs, mechs));

	nameType = GSSName.NT_EXPORT_NAME;
	mechs = gssManager.getMechsForName(nameType);
	assertTrue(Arrays.equals(expectedMechs, mechs));

	nameType = KerberosUtils.KRB5_PRINCIPAL_NAMETYPE;
	mechs = gssManager.getMechsForName(nameType);
	assertTrue(Arrays.equals(expectedMechs, mechs));
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:31,代碼來源:GSSManagerImplTest.java

示例4: testHostbasedService2

public void testHostbasedService2() throws Exception {
GSSName n1 = new GlobusGSSName("[email protected]", GSSName.NT_HOSTBASED_SERVICE);
GSSName n2 = new GlobusGSSName("/C=US/O=Globus/CN=globuscvs.mcs.anl-external.org", null);

assertEquals("/CN=host/globuscvs.mcs.anl-external.org", n1.toString());
assertTrue(n1.equals(n2));

GSSName m1 = new GlobusGSSName("[email protected]", GSSName.NT_HOSTBASED_SERVICE);
GSSName m2 = new GlobusGSSName("/C=US/O=Globus/CN=dc-user2.isi.edu", null);

assertEquals("/CN=host/dc-user2.isi.edu", m1.toString());
assertTrue(m1.equals(m2));
   }
 
開發者ID:NCIP,項目名稱:cagrid-general,代碼行數:13,代碼來源:GlobusGSSNameTest.java

示例5: testEquals2

public void testEquals2() throws Exception {

GSSName n1 = new GlobusGSSName("[email protected]", GSSName.NT_HOSTBASED_SERVICE);
GSSName n2 = new GlobusGSSName("/C=US/O=Globus/CN=pitcairn.mcs.anl.gov", null);
GSSName n3 = new GlobusGSSName("/C=US/O=Globus/CN=host/pitcairn.MCS.anl.gov", null);
GSSName n4 = new GlobusGSSName("/C=US/O=Globus/CN=ftp/pitcairn.mcs.anl.gOv", null);
GSSName n5 = new GlobusGSSName("[email protected]", GSSName.NT_HOSTBASED_SERVICE);
GSSName n6 = new GlobusGSSName("[email protected]", GSSName.NT_HOSTBASED_SERVICE);
GSSName n7 = new GlobusGSSName("/C=US/O=Globus/CN=pitcairn-9.mcs.anl.gov", null);

assertTrue(n1.equals(n1));
assertTrue(n2.equals(n2));

assertTrue(n1.equals(n2));
assertTrue(n2.equals(n1));

assertTrue(n1.equals(n3));
assertTrue(n3.equals(n1));

assertTrue(!n4.equals(n1));
assertTrue(n5.equals(n4));
assertTrue(n4.equals(n5));

assertTrue(!n1.equals(n5));

assertTrue(n1.equals(n6));

assertTrue(n7.equals(n6));

assertTrue(!n2.equals(n3));
assertTrue(!n3.equals(n4));
assertTrue(!n4.equals(n7));
   }
 
開發者ID:NCIP,項目名稱:cagrid-general,代碼行數:33,代碼來源:GlobusGSSNameTest.java

示例6: testExport

public void testExport() throws Exception {
	KerberosName kerberosName = new KerberosName("[email protected]", GSSName.NT_HOSTBASED_SERVICE);
	byte[] exported = kerberosName.export();
	byte[] expected = new byte[] { 4,1,0,11,6,9,42,-122,72,-122,-9,18,1,2,2,0,0,0,17,115,101,114,118,105,99,101,47,108,111,99,97,108,104,111,115,116 };
	assertTrue(Arrays.equals(expected, exported));		
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:6,代碼來源:KerberosNameTest.java

示例7: testEquals

public void testEquals() throws Exception{
	KerberosName one = new KerberosName("[email protected]", GSSName.NT_HOSTBASED_SERVICE);
	KerberosName another = new KerberosName("[email protected]", GSSName.NT_HOSTBASED_SERVICE);
	assertEquals(one, another);
	
	one = new KerberosName("[email protected]", GSSName.NT_HOSTBASED_SERVICE);
	another = new KerberosName("service/localhost", GSSName.NT_HOSTBASED_SERVICE);
	assertEquals(one, another);
	
	one = new KerberosName("[email protected]", GSSName.NT_USER_NAME);
	another = new KerberosName("[email protected]", GSSName.NT_USER_NAME);
	assertEquals(one, another);
	
	one = new KerberosName("[email protected]", GSSName.NT_USER_NAME);
	another = new KerberosName("service/localhost", GSSName.NT_USER_NAME);
	assertFalse(one.equals(another));
	
	final Oid KRB5_PRINCIPAL_NAMETYPE = new Oid("1.2.840.113554.1.2.2.1");
	one = new KerberosName("[email protected]", KRB5_PRINCIPAL_NAMETYPE);
	another = new KerberosName("[email protected]", KRB5_PRINCIPAL_NAMETYPE);
	assertEquals(one, another);
	
	one = new KerberosName("[email protected]", KRB5_PRINCIPAL_NAMETYPE);
	another = new KerberosName("service/localhost",KRB5_PRINCIPAL_NAMETYPE);
	assertFalse(one.equals(another));
	
	one = new KerberosName("[email protected]", KRB5_PRINCIPAL_NAMETYPE);
	another = new KerberosName("[email protected]", GSSName.NT_USER_NAME);
	assertEquals(one,another);
	
	one = new KerberosName("[email protected]", KRB5_PRINCIPAL_NAMETYPE);
	another = new KerberosName("[email protected]", GSSName.NT_HOSTBASED_SERVICE);
	assertFalse(one.equals(another));
	
	one = new KerberosName("service/localhost", KRB5_PRINCIPAL_NAMETYPE);
	another = new KerberosName("[email protected]", GSSName.NT_HOSTBASED_SERVICE);
	assertEquals(one,another);
	
	one = new KerberosName("[email protected]", GSSName.NT_USER_NAME);
	another = new KerberosName("[email protected]", GSSName.NT_HOSTBASED_SERVICE);
	assertFalse(one.equals(another));
	
	one = new KerberosName("service/localhost", GSSName.NT_USER_NAME);
	another = new KerberosName("[email protected]", GSSName.NT_HOSTBASED_SERVICE);
	assertFalse(one.equals(another));
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:46,代碼來源:KerberosNameTest.java

示例8: testHostbasedService3

public void testHostbasedService3() throws Exception {
GSSName n1 = new GlobusGSSName("[email protected]", GSSName.NT_HOSTBASED_SERVICE);
GSSName n2 = new GlobusGSSName("/C=US/O=Globus/CN=host/pitcairn.mcs.anl.gov/CN=12345678", null);

assertTrue(n1.equals(n2));
   }
 
開發者ID:NCIP,項目名稱:cagrid-general,代碼行數:6,代碼來源:GlobusGSSNameTest.java

示例9: testConversion

public void testConversion() throws Exception {

GSSName n1 = new GlobusGSSName("[email protected]", GSSName.NT_HOSTBASED_SERVICE);

assertEquals("/CN=ftp/pitcairn.mcs.anl.gov", n1.toString());

GSSName n2 = new GlobusGSSName("/C=US/O=Globus/O=ANL/CN=gawor", null);

assertEquals("/C=US/O=Globus/O=ANL/CN=gawor", n2.toString());
   }
 
開發者ID:NCIP,項目名稱:cagrid-general,代碼行數:10,代碼來源:GlobusGSSNameTest.java


注:本文中的org.ietf.jgss.GSSName.NT_HOSTBASED_SERVICE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。