diff options
Diffstat (limited to 'src/plop_compat.erl')
-rw-r--r-- | src/plop_compat.erl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/plop_compat.erl b/src/plop_compat.erl index d9f3620..d59edf0 100644 --- a/src/plop_compat.erl +++ b/src/plop_compat.erl @@ -1,9 +1,12 @@ -module(plop_compat). --export([unpack_spki/1]). +-export([unpack_spki/1, timestamp/0]). -include_lib("public_key/include/public_key.hrl"). unpack_spki(SPKI) -> unpack_spki(erlang:system_info(otp_release), SPKI). +timestamp() -> + timestamp(erlang:system_info(otp_release)). + unpack_spki("17", SPKI) -> #'SubjectPublicKeyInfo'{subjectPublicKey = {_, Octets}, @@ -13,3 +16,9 @@ unpack_spki("18", SPKI) -> #'SubjectPublicKeyInfo'{subjectPublicKey = Octets, algorithm = Algorithm} = SPKI, {Octets, Algorithm}. + +%% <=R17: now/0, >=R18 timestamp/0 +timestamp("17") -> + erlang:now(); +timestamp("18") -> + erlang:timestamp(). |