Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for calculateMac (0.09 sec)

  1. src/test/java/jcifs/pac/PacMacTest.java

            // Test HMAC-MD5
            byte[] mac1 = PacMac.calculateMac(PacSignature.KERB_CHECKSUM_HMAC_MD5, keys, TEST_DATA);
            assertNotNull(mac1);
            assertEquals(16, mac1.length);
    
            // Test AES128
            byte[] mac2 = PacMac.calculateMac(PacSignature.HMAC_SHA1_96_AES128, keys, TEST_DATA);
            assertNotNull(mac2);
            assertEquals(12, mac2.length);
    
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 07:14:38 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  2. src/test/java/jcifs/pac/PacTest.java

            try (MockedStatic<PacMac> pacMacMock = mockStatic(PacMac.class)) {
                // Mock the calculateMac method to return a valid checksum
                byte[] mockChecksum = new byte[16];
                pacMacMock.when(() -> PacMac.calculateMac(anyInt(), any(), any())).thenReturn(mockChecksum);
    
                // Create a minimal valid PAC structure
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7.9K bytes
    - Viewed (0)
  3. src/main/java/jcifs/pac/Pac.java

                        this.serverSignature.getType(), Hexdump.toHexString(this.serverSignature.getChecksum())));
            }
    
            byte checksum[] = PacMac.calculateMac(this.serverSignature.getType(), keys, checksumData);
            if (!MessageDigest.isEqual(this.serverSignature.getChecksum(), checksum)) {
                if (log.isDebugEnabled()) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 7.3K bytes
    - Viewed (0)
  4. src/main/java/jcifs/pac/PacMac.java

         * @param data the data to calculate the MAC for
         * @return the calculated mac bytes
         * @throws PACDecodingException if the MAC calculation fails or required keys are missing
         */
        public static byte[] calculateMac(int type, Map<Integer, KerberosKey> keys, byte[] data) throws PACDecodingException {
            try {
                int usage = 17;
                if (type == PacSignature.KERB_CHECKSUM_HMAC_MD5) {
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 9K bytes
    - Viewed (0)
  5. src/test/java/jcifs/smb/SpnegoContextTest.java

            verify(this.mechContext, times(1)).dispose();
        }
    
        @Test
        @DisplayName("calculateMIC throws when context not established")
        void testCalculateMICRequiresEstablished() throws Exception {
            SpnegoContext ctx = newContext();
            CIFSException ex = assertThrows(CIFSException.class, () -> ctx.calculateMIC(new byte[] { 1 }));
            assertEquals("Context is not established", ex.getMessage());
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 9.3K bytes
    - Viewed (0)
  6. src/main/java/jcifs/smb/SSPContext.java

         * @param data the data to calculate MIC for
         * @return MIC
         * @throws CIFSException if an error occurs calculating the MIC
         */
        byte[] calculateMIC(byte[] data) throws CIFSException;
    
        /**
         * Verifies a Message Integrity Code (MIC) for the given data.
         * @param data the data to verify
         * @param mic the MIC to verify against
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 3.9K bytes
    - Viewed (0)
Back to top