com.ibm.crypto.fips.provider

Class SigUtil

  • java.lang.Object
    • com.ibm.crypto.fips.provider.SigUtil


  • public class SigUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor and Description
      SigUtil() 
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      static java.lang.String byteArrayToHexString(byte[] b)
      Converts a Byte Array into a Hex String
      static void IncLastByte(byte[] buf)
      Increments the last byte.
      static byte[] padWithZeros(byte[] bytes) 
      static byte[] padWithZeros(byte[] bytes, int len)
      Pad with zeros if necessary
      static byte[] stripOffSignByte(byte[] bytes)
      You'd better only do this if you KNOW that this is a positive number!!! BigInteger.toByteArray() will output an extra leading 00 byte if the high-order bit is on in the first nibble of output.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SigUtil

        public SigUtil()
    • Method Detail

      • stripOffSignByte

        public static byte[] stripOffSignByte(byte[] bytes)
        You'd better only do this if you KNOW that this is a positive number!!! BigInteger.toByteArray() will output an extra leading 00 byte if the high-order bit is on in the first nibble of output. This will really hose up HASHes.
        Parameters:
        bytes - byte array with potential extra byte of zero in front
        Returns:
      • padWithZeros

        public static byte[] padWithZeros(byte[] bytes)
      • padWithZeros

        public static byte[] padWithZeros(byte[] bytes,
                          int len)
        Pad with zeros if necessary
        Parameters:
        bytes -
        len -
        Returns:
      • byteArrayToHexString

        public static java.lang.String byteArrayToHexString(byte[] b)
        Converts a Byte Array into a Hex String
      • IncLastByte

        public static void IncLastByte(byte[] buf)
        Increments the last byte. Overflows to Zero after reaching the maximum 0XFFFFF etc.
        Parameters:
        buf -
© Portions Copyright 2003, 2014, 2015, 2016 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2014 Oracle and/or its affiliates. All rights reserved.