Last active
November 30, 2015 03:43
-
-
Save mafrasi2/d7472ffd5c9bf8cc4e52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sämtliche Datentypen, die in der Struktur vorkommen, implementieren das hier. | |
// parseDER wird immer mit den Daten für exakt dieses Objekt aufgerufen. | |
abstract class ASN1Object { | |
abstract static ASN1Object parseDER(bytevector_t data); | |
}; | |
class ASN1Integer extends ASN1Object { | |
bytevector data; // oder mpz_class etc. | |
static ASN1Integer parseDER... | |
} | |
class ASN1Sequence extends ASN1Object { | |
vector<ASN1Object> elements; | |
static ASN1Sequence parseDER... | |
} | |
// die Hauptklasse, die ein Nutzer aufrufen würde (indem er seine Daten an ASN1Structure.parseDER() übergibt) | |
class ASN1Structure extends ASN1Object { | |
vector<ASN1Object> elements; | |
static ASN1Structure parseDER... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment