from __future__ import print_function, division, absolute_import

#
# Copyright (c) 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
# along with this software; if not, see
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
#
# Red Hat trademarks are not licensed under GPLv2. No permission is
# granted to use or replicate Red Hat trademarks that are incorporated
# in this software or its documentation.
#

# A product cert from Candlepin's test data (product ID 100000000000002):
PRODUCT_CERT_V1_0 = """
-----BEGIN CERTIFICATE-----
MIIDeDCCAuGgAwIBAgIECgf/jTANBgkqhkiG9w0BAQUFADAzMRIwEAYDVQQDDAls
b2NhbGhvc3QxCzAJBgNVBAYTAlVTMRAwDgYDVQQHDAdSYWxlaWdoMB4XDTExMDgy
MzE3NDEzOVoXDTIxMDgyMzE3NDEzOVowGjEYMBYGA1UEAxMPMTAwMDAwMDAwMDAw
MDAyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkbvsjJXu+vRzbBa+
G9S77gbQTtSbZXWncykJkinwqQkUl2jEnGN+BBYa30dfLFatkA6UP4XICIu+xVMw
qXc2O82BBubYvBTcqJy62U1YQnJFz/upSF0b9mKhcwJv2sAqMfkviGTYpjuCTfw6
VVSFUvIj+K16vRzZWgn+qTIUIt8yXipuz7E/4t+R2BG/9GCqjQq7LQb4y0FmWdGT
OehTjEY+G4+evsjyom5hXLgXlMhd3vkb7gHOyc3Yuk9h9eqGKg0oCiaF88KafMcu
hCp0mIC7W97jE2tHTWzfERw99j+uPjccBUljqVpNfW6S/iKDx0tkzv0pOnSxYYmd
HF5rbQIDAQABo4IBLDCCASgwEQYJYIZIAYb4QgEBBAQDAgWgMAsGA1UdDwQEAwIE
sDBjBgNVHSMEXDBagBQckL9Tc4HS6Df/ppG4uN7zSUsnD6E3pDUwMzESMBAGA1UE
AwwJbG9jYWxob3N0MQswCQYDVQQGEwJVUzEQMA4GA1UEBwwHUmFsZWlnaIIJAPrR
0C/V93lLMB0GA1UdDgQWBBQPunbOh02rAFia+TmNDHCa05vI/DATBgNVHSUEDDAK
BggrBgEFBQcDAjAxBhErBgEEAZIICQGW3rGD6YACAQQcDBpBd2Vzb21lIE9TIGZv
ciB4ODZfNjQgQml0czAdBhErBgEEAZIICQGW3rGD6YACAwQIDAZ4ODZfNjQwGwYR
KwYBBAGSCAkBlt6xg+mAAgIEBgwEMy4xMTANBgkqhkiG9w0BAQUFAAOBgQARCW1E
d/w1WYaQElsYAN9/EyDXyXq4GJfTFES8eg09nUKYrMACds2wdh8m8vV7NtHl8E0y
wE//vrTlHGSD5m4/mcXsgpkHvbj/kOTP7aag7RPa51M8ocjtOplugUyIF0PsXO4B
SOxSnd1U0dX6pzEwMaJD9lCW8xZ2jsmdLUtLzQ==
-----END CERTIFICATE-----
"""

# FIXME: remove
# A product cert from Candlepin's test data (product 37060, Awesome
# OS server bits", this one with the "brand_type" oid added.
PRODUCT_CERT_WITH_OS_NAME_V1_0 = """
-----BEGIN CERTIFICATE-----
MIIDejCCAuOgAwIBAgIEAuhqBjANBgkqhkiG9w0BAQUFADBDMSIwIAYDVQQDDBlk
aGNwMjMxLTI4LnJkdS5yZWRoYXQuY29tMQswCQYDVQQGEwJVUzEQMA4GA1UEBwwH
UmFsZWlnaDAeFw0xMjA0MDIxODQ5NTlaFw0yMjA0MDIxODQ5NTlaMBAxDjAMBgNV
BAMTBTM3MDYwMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjwldtpsx
qrXrob1CTPL5Wp3gY0mLsNqOCtd+PSUXLxTqgosktnp5Y6qIzllC4JnZDyjECKto
6Lt9JIaSKTq7ku5eBVg1WQ85skt37nriNc8ChjB2yA39szd7UtPB35Kmn+ItQP8a
pcaCQcUPLgNxa23n4YoEiUQOMnh94GAprhBBhuEwFKehKiI9H9FxvqrWRGCqLBBJ
zflJTo4dX5qf0qX9X23Ukb3PtVcsa8Y4vfhUloJvvzo62bcv64bNbXsLUXMvdWy1
px98SUwuFLot3MSZ4g4axEeTbtGDPUVqr1GxE+NN/7/qug4U/drgDsSagb9LUGcT
1H24cs42vJBEcwIDAQABo4IBKDCCASQwEQYJYIZIAYb4QgEBBAQDAgWgMAsGA1Ud
DwQEAwIEsDBzBgNVHSMEbDBqgBRO8xc0xHgseEqLc1Hzn2fDN/74saFHpEUwQzEi
MCAGA1UEAwwZZGhjcDIzMS0yOC5yZHUucmVkaGF0LmNvbTELMAkGA1UEBhMCVVMx
EDAOBgNVBAcMB1JhbGVpZ2iCCQC/s2gOKUGq5DAdBgNVHQ4EFgQUw/jCiPX1vUBM
k24ZzCywPw3yjUwwEwYDVR0lBAwwCgYIKwYBBQUHAwIwKQYNKwYBBAGSCAkBgqFE
AQQYDBZBd2Vzb21lIE9TIFNlcnZlciBCaXRzMBYGDSsGAQQBkggJAYKhRAMEBQwD
QUxMMBYGDSsGAQQBkggJAYKhRAIEBQwDNi4xMA0GCSqGSIb3DQEBBQUAA4GBAF6t
KC2GWH+HzIQlapw7f+TkZbWhYeDqHDL2LJkFPcTt2KDRV86okdeIRHa1bHZSqDnY
3VP4xOrhpfXDtLULsox7dm/BCdXyvK16MwaYGxFjsWOTnDQk3MhEugXomch5DrjU
O04owaV6c4MmAy1odMk8E3bZRqPtAO1qxwTPRY7P
-----END CERTIFICATE-----
"""

# Test entitlement to the product cert above:
ENTITLEMENT_CERT_V1_0 = """
-----BEGIN CERTIFICATE-----

Z9DOOKAxJ8/KPAjBmSA=
-----END CERTIFICATE-----
"""


ENTITLEMENT_CERT_V3_0 = """
-----BEGIN CERTIFICATE-----
MIIDjzCCAvigAwIBAgIIEiB+vHfSYuwwDQYJKoZIhvcNAQEFBQAwMDEPMA0GA1UE
AwwGcGlwYm95MQswCQYDVQQGEwJVUzEQMA4GA1UEBwwHUmFsZWlnaDAeFw0xMjA5
MTgwMDAwMDBaFw0xMzA5MTgwMDA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vAcMGVzFkvL6QtzyNKa
t6+/
-----END CERTIFICATE-----
-----BEGIN ENTITLEMENT DATA-----
eJydUl1vmzAU/SvI6iMMG1NCeNue9jZp29OmKvIXKQrYzDZNo6j/fdeQ0kT5aFU+
hM25595z7vUeCaPd0CmLKsSZpJLldUJzLpOcLklS3tc8KReiXt4XC8o5RTH6NzDt
G79DVRYjN3AnbNP7xmhU7ZHbDJCJbZUznTIueS6LVZEDS7NOAfJ1QqIfv6La2GiG
t8zqRq9RRTEkNWKjvEMVgbVnYgPIqpFAJ+glRsbKoHeP9NDxUXldlxhuQpdymfMc
42klMCnhHQu8qSZ4zGo9EDNMsgQvE1L+xrganz8QrLScQHoBhI55y0SgFwvYMyHM
oMOWZJQSQuEz6uytkYMIPv7u0SQfH1/ZO22JvjVAjtGTsm5sL6JfCAkVrXhsvBJ+
sCpkR4c2PkziVBAzl4R4v+tDkd3QvVVk7ZbtXKI0462SySsvRi3jqr0V8ATdMaHr
XjmfHHbglvlH+JnWxqRhnU4J0jurWsWcAhcQte7Xq8G2lwIBgoBOeSaZZyv13DcW
lGYYv8SvZgjJ8muGzs/cbOUcmk38VDL6zvyRgVGTN+nMSmfWoRmoqlnr1ImbcxaA
6SVDtDhyhK+40aFfN6ZzDf/ocPRhHjccncZeG09xOh5C3xvPpbl8bCB3HI5ROPvH
Zyo9TvL5eTzA/R9AE5nG
-----END ENTITLEMENT DATA-----
-----BEGIN RSA SIGNATURE-----
FWYaGqnaDRpuaKLEXu9RtxNLbp3q7BM651s1P1jwlE/Ff1GMZrzsreBfRa4FE6ST
jdWIkOEVpZPEHtdnHlpQaphYDOQBfdSGrOb2ksKqfp0qKrqT4dvzau5IzqtVmkTJ
SgW0kgf/C5sFxdgD6s9NKmP/u6OgI/qqE+KfnCex/ko=
-----END RSA SIGNATURE-----
"""

ENTITLEMENT_CERT_V3_0_NO_CONTENT= """
-----BEGIN CERTIFICATE-----
MIIDejCCAuOgAwIBAgIIY4bpXjAB064wDQYJKoZIhvcNA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uHMgiO7FizI4nu0W0WLDuuzgC2CMjfniSV93VjBwYjYuVwOGazcssl5
mWBrODrkVzB/wBbqRtoQ//PjaE07fCBszdxgCsyc
-----END CERTIFICATE-----
-----BEGIN ENTITLEMENT DATA-----
eJx1UE1r4zAQ/StmTi1URWPFjuVbe+mlC4HtqaUUWZZ3RfyRlUdhQ8h/35ECe2kL
BnnevPfmzZzBLvMaJxegBVVZjVpqUdWyEhtEKRqLg9CDLnWtdKcHhDv4E81Mnk7Q
Vnewxm61wR/ILzO0Z1j3kZ2CmUoxxZG8IQqsmc3kGP+RIPHAmO8iueInGbs33eiK
m7J4erxlJkuhLdnYhaO3LnmO7uhGVu+Cm3ycmESnQ7J7To1CwYXpycnPvz58z43/
o0XGBbmVEmsJfdr0DHOcurxzRkRTbysl9aflyARiUimxEYgC9YuUbf5emevm/trU
XzT5rhSMTXLJpbF2iXOqsFQKUfGDKdIhLH20tEL7doYcXkv5/cWe/eTJ9cXuKmPi
0YU1Hx/wPk8K9jdTLMXgkiv8beqPegPv10wuhXh7v3B5WJYxHSNP3ciyGczW1NvS
SnQoMf/Vg5KNVHYDl8s/gJaozA==
-----END ENTITLEMENT DATA-----
-----BEGIN RSA SIGNATURE-----
GgQryM9Caj38NNvVS/+wiAFzhxkBxtci+oNVkXG2HwUEuw8nVXRv/DpIHkfLTLm5
gRiWpxSH036c4bfOsXaBtYlvwh2UDBS3WDhh0e7st4IEt9Be70T7XAgLCXUAILMe
U2cdYX6mLGP/5bBrpCwjz/jECXuGp+pO2I+srx7bujQ=
-----END RSA SIGNATURE-----
"""


IDENTITY_CERT = """
-----BEGIN CERTIFICATE-----
MIIDdzCCAuCgAwIBAgIIBdnhr/WCKpMwDQYJKoZIhvcNAQEFBQAwTDErMCkGA1UE
Awwid3BvdGVhdC1kZXNrdG9wLnVzZXJzeXMucmVkaGF0LmNvbTELMAkGA1UEBhMC
VVMxEDAOBgNVBAcMB1JhbGVpZ2gwHhcNMTQwNTA4MTMwNDA0WhcNMzA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of the certs above.
# NOTE: Some editors will automatically replace tabs/spaces
#       and remove trailing whitespace. This will cause
#       test errors if this happens.

ENTITLEMENT_CERT_V1_0_OUTPUT = """
+-------------------------------------------+
\tEntitlement Certificate
+-------------------------------------------+

Certificate:
\tPath:%(space)s
\tVersion: 1.0
\tSerial: 60063758564076674
\tStart Date: 2012-09-07 00:00:00+00:00
\tEnd Date: 2013-09-07 00:00:00+00:00
\tPool ID: Not Available

Subject:
\tCN: ff80808139affbb50139b5841809706e

Issuer:
\tC: US
\tCN: boogady
\tL: Raleigh

Product:
\tID: 37060
\tName: Awesome OS Server Bits
\tVersion: 6.1
\tArch: ALL
\tTags:%(space)s
\tBrand Type:%(space)s
\tBrand Name:%(space)s

Product:
\tID: 37065
\tName: Clustering Bits
\tVersion: 1.0
\tArch: ALL
\tTags:%(space)s
\tBrand Type:%(space)s
\tBrand Name:%(space)s

Product:
\tID: 37067
\tName: Shared Storage Bits
\tVersion: 1.0
\tArch: ALL
\tTags:%(space)s
\tBrand Type:%(space)s
\tBrand Name:%(space)s

Product:
\tID: 37068
\tName: Large File Support Bits
\tVersion: 1.0
\tArch: ALL
\tTags:%(space)s
\tBrand Type:%(space)s
\tBrand Name:%(space)s

Product:
\tID: 37069
\tName: Management Bits
\tVersion: 1.0
\tArch: ALL
\tTags:%(space)s
\tBrand Type:%(space)s
\tBrand Name:%(space)s

Product:
\tID: 37070
\tName: Load Balancing Bits
\tVersion: 1.0
\tArch: ALL
\tTags:%(space)s
\tBrand Type:%(space)s
\tBrand Name:%(space)s

Order:
\tName: Awesome OS Server Bundled
\tNumber: ff80808139a0a7160139a0a8501d0295
\tSKU: awesomeos-server
\tContract: 359
\tAccount: 12331131231
\tService Type: Level 3
\tRoles: 
\tService Level: Premium
\tUsage: 
\tAdd-ons: 
\tQuantity: 10
\tQuantity Used: 1
\tSocket Limit: 2
\tRAM Limit:%(space)s
\tCore Limit:%(space)s
\tVirt Only: False
\tStacking ID:%(space)s
\tWarning Period: 30
\tProvides Management: 1

Content:
\tType: yum
\tName: always-enabled-content
\tLabel: always-enabled-content
\tVendor: test-vendor
\tURL: /foo/path/always/$releasever
\tGPG: /foo/path/always/gpg
\tEnabled: True
\tExpires: 200
\tRequired Tags:%(space)s
\tArches:%(space)s

Content:
\tType: yum
\tName: content
\tLabel: content-label
\tVendor: test-vendor
\tURL: /foo/path
\tGPG: /foo/path/gpg/
\tEnabled: True
\tExpires: 0
\tRequired Tags:%(space)s
\tArches:%(space)s

Content:
\tType: yum
\tName: content-emptygpg
\tLabel: content-label-empty-gpg
\tVendor: test-vendor
\tURL: /foo/path
\tGPG:%(space)s
\tEnabled: True
\tExpires: 0
\tRequired Tags:%(space)s
\tArches:%(space)s

Content:
\tType: yum
\tName: content-nogpg
\tLabel: content-label-no-gpg
\tVendor: test-vendor
\tURL: /foo/path
\tGPG:%(space)s
\tEnabled: True
\tExpires: 0
\tRequired Tags:%(space)s
\tArches:%(space)s

Content:
\tType: yum
\tName: never-enabled-content
\tLabel: never-enabled-content
\tVendor: test-vendor
\tURL: /foo/path/never
\tGPG: /foo/path/never/gpg
\tEnabled: False
\tExpires: 600
\tRequired Tags:%(space)s
\tArches:%(space)s

Content:
\tType: yum
\tName: tagged-content
\tLabel: tagged-content
\tVendor: test-vendor
\tURL: /foo/path/always
\tGPG: /foo/path/always/gpg
\tEnabled: True
\tExpires:%(space)s
\tRequired Tags: TAG1, TAG2
\tArches:%(space)s
""" % ({'space': ' '})

ENTITLEMENT_CERT_V3_0_OUTPUT = """
+-------------------------------------------+
\tEntitlement Certificate
+-------------------------------------------+

Certificate:
\tPath:%(space)s
\tVersion: 3.0
\tSerial: 1306183239866671852
\tStart Date: 2012-09-18 00:00:00+00:00
\tEnd Date: 2013-09-18 00:00:00+00:00
\tPool ID: Not Available

Subject:
\tCN: ff80808139d9e26c0139da23489a0066

Issuer:
\tC: US
\tCN: pipboy
\tL: Raleigh

Product:
\tID: 100000000000002
\tName: Awesome OS for x86_64 Bits
\tVersion: 3.11
\tArch: x86_64
\tTags:%(space)s
\tBrand Type:%(space)s
\tBrand Name:%(space)s

Order:
\tName: Awesome OS for x86_64
\tNumber: ff80808139d94b400139d94c018c0164
\tSKU: awesomeos-x86_64
\tContract: 67
\tAccount: 12331131231
\tService Type:%(space)s
\tRoles: 
\tService Level:%(space)s
\tUsage: 
\tAdd-ons: 
\tQuantity: 10
\tQuantity Used: 2
\tSocket Limit: 1
\tRAM Limit:%(space)s
\tCore Limit:%(space)s
\tVirt Only: False
\tStacking ID: 1
\tWarning Period: 30
\tProvides Management: False

Authorized Content URLs:
\t/foo/path/always/$releasever
\t/foo/path/never
\t/path/to/$basearch/$releasever/awesomeos
\t/path/to/awesomeos/x86_64

Content:
\tType: yum
\tName: always-enabled-content
\tLabel: always-enabled-content
\tVendor: test-vendor
\tURL: /foo/path/always/$releasever
\tGPG: /foo/path/always/gpg
\tEnabled: True
\tExpires: 200
\tRequired Tags:%(space)s
\tArches:%(space)s

Content:
\tType: yum
\tName: awesomeos
\tLabel: awesomeos
\tVendor: Red Hat
\tURL: /path/to/$basearch/$releasever/awesomeos
\tGPG: /path/to/awesomeos/gpg/
\tEnabled: True
\tExpires: 3600
\tRequired Tags:%(space)s
\tArches:%(space)s

Content:
\tType: yum
\tName: awesomeos-x86_64
\tLabel: awesomeos-x86_64
\tVendor: Red Hat
\tURL: /path/to/awesomeos/x86_64
\tGPG: /path/to/awesomeos/gpg/
\tEnabled: False
\tExpires: 3600
\tRequired Tags:%(space)s
\tArches:%(space)s

Content:
\tType: yum
\tName: never-enabled-content
\tLabel: never-enabled-content
\tVendor: test-vendor
\tURL: /foo/path/never
\tGPG: /foo/path/never/gpg
\tEnabled: False
\tExpires: 600
\tRequired Tags:%(space)s
\tArches:%(space)s
""" % ({'space': ' '})


ENTITLEMENT_CERT_V3_0_NO_CONTENT_OUTPUT = """
+-------------------------------------------+
\tEntitlement Certificate
+-------------------------------------------+

Certificate:
\tPath:%(space)s
\tVersion: 3.3
\tSerial: 7171676047375717294
\tStart Date: 2018-11-19 00:00:00+00:00
\tEnd Date: 2019-11-19 00:00:00+00:00
\tPool ID: 4028fa7a672c01e101672c06f30803c4

Subject:
\tCN: 4028fa7a672c01e101672c20d1d109be
\tO: admin

Issuer:
\tC: US
\tCN: candle.localdomain
\tL: Raleigh

Product:
\tID: 900
\tName: Multi-Attribute Limited Product
\tVersion: 1.0
\tArch: x86_64
\tTags:%(space)s
\tBrand Type:%(space)s
\tBrand Name:%(space)s

Order:
\tName: Multi-Attribute Stackable (2 GB)
\tNumber: order-8675309
\tSKU: ram2-multiattr
\tContract: 0
\tAccount: 12331131231
\tService Type: Level 3
\tRoles: 
\tService Level: Premium
\tUsage: 
\tAdd-ons: 
\tQuantity: 5
\tQuantity Used: 5
\tSocket Limit:%(space)s
\tRAM Limit: 2
\tCore Limit:%(space)s
\tVirt Only: False
\tStacking ID: multiattr-stack-test
\tWarning Period: 0
\tProvides Management: False

""" % ({'space': ' '})

PRODUCT_CERT_V1_0_OUTPUT = """
+-------------------------------------------+
\tProduct Certificate
+-------------------------------------------+

Certificate:
\tPath:%(space)s
\tVersion: 1.0
\tSerial: 168296333
\tStart Date: 2011-08-23 17:41:39+00:00
\tEnd Date: 2021-08-23 17:41:39+00:00

Subject:
\tCN: 100000000000002

Issuer:
\tC: US
\tCN: localhost
\tL: Raleigh

Product:
\tID: 100000000000002
\tName: Awesome OS for x86_64 Bits
\tVersion: 3.11
\tArch: x86_64
\tTags:%(space)s
\tBrand Type:%(space)s
\tBrand Name:%(space)s

""" % ({'space': ' '})


PRODUCT_CERT_WITH_OS_NAME_V1_0_OUTPUT = """
+-------------------------------------------+
\tProduct Certificate
+-------------------------------------------+

Certificate:
\tPath:%(space)s
\tVersion: 1.0
\tSerial: 48785926
\tStart Date: 2012-04-02 18:49:59+00:00
\tEnd Date: 2022-04-02 18:49:59+00:00

Subject:
\tCN: 37060

Issuer:
\tC: US
\tCN: dhcp231-28.rdu.redhat.com
\tL: Raleigh

Product:
\tID: 37060
\tName: Awesome OS Server Bits
\tVersion: 6.1
\tArch: ALL
\tTags:%(space)s
\tBrand Type:%(space)s
\tBrand Name:%(space)s

""" % ({'space': ' '})

IDENTITY_CERT_OUTPUT = """
+-------------------------------------------+
\tIdentity Certificate
+-------------------------------------------+

Certificate:
\tPath:%(space)s
\tVersion: 1.0
\tSerial: 421616185990326931
\tStart Date: 2014-05-08 13:04:04+00:00
\tEnd Date: 2030-05-08 13:04:04+00:00
\tAlt Name: URI:CN=redhat.local.rm-rf.ca

Subject:
\tCN: 0f5d4617-d913-4a0f-be61-d8a9c88e1476

Issuer:
\tC: US
\tCN: wpoteat-desktop.usersys.redhat.com
\tL: Raleigh

""" % ({'space': ' '})

PRODUCT_CERT_V1_0_STAT_OUTPUT = \
"""Type: Product Certificate
Version: 1.0
DER size: 892b
Subject Key ID size: 20b
"""

PRODUCT_CERT_WITH_OS_NAME_V1_0_STAT_OUTPUT = \
"""Type: Product Certificate
Version: 1.0
DER size: 894b
Subject Key ID size: 20b
"""

ENTITLEMENT_CERT_V3_0_STAT_OUTPUT = \
"""Type: Entitlement Certificate
Version: 3.0
DER size: 915b
Subject Key ID size: 20b
Content sets: 4
"""
