Class PaddingOps

java.lang.Object
se.swedenconnect.opensaml.xmlsec.algorithm.PaddingOps

public class PaddingOps extends Object
Static data operations for PSS padding.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte[]
    concatenate(byte[]... arrays)
    Concatenates the supplied arrays into one.
    static byte[]
    i2osp(BigInteger val, int len)
    Convert a BigInteger value to a byte array of a specified length.
    static BigInteger
    os2ip(byte[] val)
    Converts a byte array to a BigInteger.
    static byte[]
    xor(byte[] arg1, byte[] arg2)
    Performs bitwise XOR operation on two byte arrays.

    Methods inherited from class java.lang.Object

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

    • PaddingOps

      public PaddingOps()
  • Method Details

    • i2osp

      public static byte[] i2osp(BigInteger val, int len)
      Convert a BigInteger value to a byte array of a specified length.
      Parameters:
      val - the BigInteger value to be converted
      len - the length of the resulting byte array
      Returns:
      the byte array representation of the BigInteger value
      Throws:
      IllegalArgumentException - if the value requires more bytes than the assigned length size
    • os2ip

      public static BigInteger os2ip(byte[] val)
      Converts a byte array to a BigInteger.
      Parameters:
      val - the byte array to convert
      Returns:
      the BigInteger representation of the byte array
    • xor

      public static byte[] xor(byte[] arg1, byte[] arg2)
      Performs bitwise XOR operation on two byte arrays.
      Parameters:
      arg1 - the first byte array
      arg2 - the second byte array
      Returns:
      the result of the XOR operation as a new byte array
      Throws:
      NullPointerException - if either arg1 or arg2 is null
      IllegalArgumentException - if arg1 and arg2 have different lengths
    • concatenate

      public static byte[] concatenate(byte[]... arrays)
      Concatenates the supplied arrays into one.
      Parameters:
      arrays - the arrays to concatenate
      Returns:
      a concatenated array