001 package org.bouncycastle.asn1;
002
003 public abstract class ASN1Object implements ASN1Encodable
004 {
005 public int hashCode()
006 {
007 return this.toASN1Primitive().hashCode();
008 }
009
010 public boolean equals(Object par1Obj)
011 {
012 if (this == par1Obj)
013 {
014 return true;
015 }
016 else if (!(par1Obj instanceof ASN1Encodable))
017 {
018 return false;
019 }
020 else
021 {
022 ASN1Encodable var2 = (ASN1Encodable)par1Obj;
023 return this.toASN1Primitive().equals(var2.toASN1Primitive());
024 }
025 }
026
027 public abstract ASN1Primitive toASN1Primitive();
028 }