Code example for SecretKey

Methods: getAlgorithmgetEncodedgetFormat

0
 
        assertSame(krbTicket.getSessionKey(), krbTicket.getSessionKey());
 
        // test returned SecretKey object 
        SecretKey sKey = krbTicket.getSessionKey();
        byte[] keyBytes = sKey.getEncoded();
 
        assertTrue(Arrays.equals(sessionKey, keyBytes));
        // initial byte array is copied 
        assertNotSame(sessionKey, sKey.getEncoded());
        // key instance is immutable  
        assertNotSame(sKey.getEncoded(), sKey.getEncoded());
 
        assertEquals("algorithm", "DES", sKey.getAlgorithm());
        assertEquals("format", "RAW", sKey.getFormat());
 
        // sessionKey: null value is illegal for constructor 
        try { 
            new KerberosTicket(ticket, pClient, pServer, null, KEY_TYPE, flags,
                    authTime, startTime, endTime, renewTill, addesses);
Connect your IDE to all the code out there  Get Codota for Java