CompositeKey.NodeAndWeight
Keywords: net.corda.core.crypto.CompositeKey.NodeAndWeight class
Date: 2023-09-18

net.corda.core.crypto

## Class CompositeKey.NodeAndWeight

- net.corda.core.crypto.CompositeKey.NodeAndWeight

- Enclosing class:
    CompositeKey

      public static class CompositeKey.NodeAndWeight

  Holds node - weight pairs for a CompositeKey. Ordered first by weight, then by node's hashCode. Each node should be assigned with a positive weight to avoid certain types of weight underflow attacks.

- - ### Constructor Detail

    - #### NodeAndWeight

          public NodeAndWeight(@NotNull
                               java.security.PublicKey node,
                               int weight)

      Holds node - weight pairs for a CompositeKey. Ordered first by weight, then by node's hashCode. Each node should be assigned with a positive weight to avoid certain types of weight underflow attacks.

  - ### Method Detail

    - #### compareTo

          public int compareTo(@NotNull
                               net.corda.core.crypto.CompositeKey.NodeAndWeight other)

    - #### toASN1Primitive

          @NotNull
          public org.bouncycastle.asn1.ASN1Primitive toASN1Primitive()

    - #### toString

          @NotNull
          public java.lang.String toString()

    - #### getNode

          @NotNull
          public java.security.PublicKey getNode()

    - #### getWeight

          public int getWeight()

    - #### component1

          @NotNull
          public java.security.PublicKey component1()

    - #### component2

          public int component2()

    - #### copy

          @NotNull
          public net.corda.core.crypto.CompositeKey.NodeAndWeight copy(@NotNull
                                                                                java.security.PublicKey node,
                                                                                int weight)

      Holds node - weight pairs for a CompositeKey. Ordered first by weight, then by node's hashCode. Each node should be assigned with a positive weight to avoid certain types of weight underflow attacks.

    - #### hashCode

          public int hashCode()

      Holds node - weight pairs for a CompositeKey. Ordered first by weight, then by node's hashCode. Each node should be assigned with a positive weight to avoid certain types of weight underflow attacks.

    - #### equals

          public boolean equals(@Nullable
                                java.lang.Object p)

      Holds node - weight pairs for a CompositeKey. Ordered first by weight, then by node's hashCode. Each node should be assigned with a positive weight to avoid certain types of weight underflow attacks.