<?php

namespace iDServer\Internal\ASN1;

/**
 * @internal
 */
class ASN1Integer
{
    /**
     * @var string
     */
    private $binary;

    /**
     * @param string $binary Binary NOT including ASN1 type and length
     * @return void
     */
    public function __construct(string $binary)
    {
        $this->binary = $binary;
    }

    /**
     * @return string
     */
    public function toBinary(): string
    {
        return $this->binary;
    }

    /**
     * @return string
     */
    public function toHex(): string
    {
        return bin2hex($this->binary);
    }
}
